MySQL installieren (Linux): Unterschied zwischen den Versionen
		
		
		
		
		
		Zur Navigation springen
		Zur Suche springen
		
				
		
		
	
| (13 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
| Zeile 1: | Zeile 1: | ||
== Installation ==  | == Installation ==  | ||
<pre   | <pre>  | ||
sudo apt-get -y install mysql-server  | |||
</pre>  | |||
=== Ubuntu-Server 16.04 ===  | |||
sudo apt-get install mysql-  | |||
sudo apt-get install php5-mysql  | <pre>  | ||
sudo apt-get -y install php-mysql    | |||
</pre>  | |||
=== Ubuntu-Server 14.04 ===  | |||
<pre>  | |||
sudo apt-get -y install php5-mysql  | |||
</pre>  | </pre>  | ||
== Netzwerkzugriff ==  | == Netzwerkzugriff ==  | ||
Um auch von einem anderem Rechner auf die Datenbank zugreifen zu können, muss noch   | Um auch von einem anderem Rechner auf die Datenbank zugreifen zu können, muss noch die IP-Adresse der Netzwerkschnittstelle eingestellt werden.  | ||
Dazu in der Konfigurationsdatei folgende Zeile anpassen:  | |||
<pre>  | |||
# Instead of skip-networking the default is now to listen only on  | # Instead of skip-networking the default is now to listen only on  | ||
# localhost which is more compatible and is not less secure.  | # localhost which is more compatible and is not less secure.  | ||
| Zeile 21: | Zeile 26: | ||
</pre>  | </pre>  | ||
==   | Um alle Netzwerke zuzulassen, die Adresse ''0.0.0.0'' verwenden:  | ||
===   | <pre>  | ||
bind-address            = 0.0.0.0  | |||
</pre>  | |||
=== Ubuntu-Server 16.04 ===  | |||
<pre>  | |||
sudo vi /etc/mysql/mysql.conf.d/mysqld.cnf   | |||
</pre>  | |||
=== Ubuntu-Server 14.04 ===  | |||
<pre>  | |||
sudo vi /etc/mysql/my.cnf  | |||
</pre>  | |||
== Passwort ==  | |||
=== Passwort setzen ===  | |||
==== Raspbian ====  | |||
Unter Raspbian wird bei der Installation nicht nach einem ''root''-Passwort gefragt.  | |||
Um es zu setzen, als ''root'' einloggen  | |||
<pre>  | |||
<pre   | sudo mysql -u root -p  | ||
sudo   | |||
</pre>  | </pre>  | ||
und folgende Befehle ausführen:  | |||
<pre>  | |||
grant all on *.* to root@localhost identified by '<password>' with grant option;  | |||
flush privileges;  | |||
quit;  | |||
</pre>  | </pre>  | ||
==== Ubuntu 18.04 ====  | |||
Mit <code>sudo -i</code> als root anmelden, danach in MySQL mittels  | |||
<pre>  | |||
mysql -u root  | |||
<  | |||
</pre>  | </pre>  | ||
anmelden und folgenden Kommandos ausführen:  | |||
<pre   | |||
<pre>  | |||
ALTER USER 'root'@'localhost'  | |||
IDENTIFIED WITH mysql_native_password BY 'NeuesPasswort';  | |||
FLUSH privileges;  | |||
QUIT;    | |||
</pre>  | </pre>  | ||
====   | === Passwort zurücksetzen ===  | ||
[https://dev.mysql.com/doc/refman/5.5/en/resetting-permissions.html https://dev.mysql.com/doc/refman/5.5/en/resetting-permissions.html]  | |||
== Werkzeuge ==  | |||
[[phpMyAdmin (Ubuntu)|phpMyAdmin]]  | |||
== Replikation ==  | |||
Siehe auch [[MySQL Cluster (Linux)|MySQL Cluster]]  | |||
=== Links ===  | |||
[https://www.thomas-krenn.com/de/wiki/MySQL_Replikation https://www.thomas-krenn.com/de/wiki/MySQL_Replikation]  | |||
== Probleme ==  | |||
=== mysqldump: Couldn't execute 'SHOW VARIABLES LIKE 'gtid\_mode'': Table 'performance_schema.session_variables' doesn't exist (1146) ===  | |||
<pre>  | |||
mysql -u root -p  | |||
mysql> set @@global.show_compatibility_56=ON;  | |||
</pre>  | </pre>  | ||
==== Links ====  | |||
[https://bugs.mysql.com/bug.php?id=78159 https://bugs.mysql.com/bug.php?id=78159]  | |||
Zurück zu [[Ubuntu]]  | Zurück zu [[Ubuntu]]  | ||
Aktuelle Version vom 23. Juli 2020, 10:28 Uhr
Installation
sudo apt-get -y install mysql-server
Ubuntu-Server 16.04
sudo apt-get -y install php-mysql
Ubuntu-Server 14.04
sudo apt-get -y install php5-mysql
Netzwerkzugriff
Um auch von einem anderem Rechner auf die Datenbank zugreifen zu können, muss noch die IP-Adresse der Netzwerkschnittstelle eingestellt werden.
Dazu in der Konfigurationsdatei folgende Zeile anpassen:
# Instead of skip-networking the default is now to listen only on # localhost which is more compatible and is not less secure. bind-address = <static IP address>
Um alle Netzwerke zuzulassen, die Adresse 0.0.0.0 verwenden:
bind-address = 0.0.0.0
Ubuntu-Server 16.04
sudo vi /etc/mysql/mysql.conf.d/mysqld.cnf
Ubuntu-Server 14.04
sudo vi /etc/mysql/my.cnf
Passwort
Passwort setzen
Raspbian
Unter Raspbian wird bei der Installation nicht nach einem root-Passwort gefragt.
Um es zu setzen, als root einloggen
sudo mysql -u root -p
und folgende Befehle ausführen:
grant all on *.* to root@localhost identified by '<password>' with grant option; flush privileges; quit;
Ubuntu 18.04
Mit sudo -i als root anmelden, danach in MySQL mittels
mysql -u root
anmelden und folgenden Kommandos ausführen:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'NeuesPasswort'; FLUSH privileges; QUIT;
Passwort zurücksetzen
https://dev.mysql.com/doc/refman/5.5/en/resetting-permissions.html
Werkzeuge
Replikation
Siehe auch MySQL Cluster
Links
https://www.thomas-krenn.com/de/wiki/MySQL_Replikation
Probleme
mysqldump: Couldn't execute 'SHOW VARIABLES LIKE 'gtid\_mode: Table 'performance_schema.session_variables' doesn't exist (1146)
mysql -u root -p mysql> set @@global.show_compatibility_56=ON;
Links
https://bugs.mysql.com/bug.php?id=78159
Zurück zu Ubuntu