Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
| mysql:reset_password [2013/09/25 10:55] – Externe Bearbeitung 127.0.0.1 | mysql:reset_password [2024/02/29 13:36] (aktuell) – Externe Bearbeitung 127.0.0.1 | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| ====== MySQL: Root-Passwort zurücksetzen ====== | ====== MySQL: Root-Passwort zurücksetzen ====== | ||
| + | |||
| + | Quelle((https:// | ||
| + | |||
| + | Ab und zu kann es passieren, dass man sein Root-Passwort für den MySQL-Root vergessen hat. Um einer Neuinstallation von MySQLvorzubeugen, | ||
| + | |||
| + | |||
| + | Grundsätzlich kann man das Rootpasswort so setzen | ||
| + | |||
| + | - Öffnen Sie auf dem Server eine Root-Konsole. | ||
| + | - Geben Sie folgenden Befehl ein: | ||
| + | |||
| + | < | ||
| + | |||
| + | Wenn man aber nicht mehr als Root reinkommt helfen diese zwei Wege. | ||
| + | |||
| + | -> Siehe quelle!! | ||
| Im Falle, dass Sie Ihr MySQL-Passwort vergessen haben, können Sie folgende Kurzanleitung verwenden, um die Root-Rechte zurück zu erlangen.\\ | Im Falle, dass Sie Ihr MySQL-Passwort vergessen haben, können Sie folgende Kurzanleitung verwenden, um die Root-Rechte zurück zu erlangen.\\ | ||
| Zeile 17: | Zeile 33: | ||
| Verlassen Sie den MySQL-Client und restarten Sie Ihren MySQL-Server. Ab jetzt sollten Sie Ihr neues Passwort verwenden können. | Verlassen Sie den MySQL-Client und restarten Sie Ihren MySQL-Server. Ab jetzt sollten Sie Ihr neues Passwort verwenden können. | ||
| + | |||
| + | ====== Can't start/stop mysql service ====== | ||
| + | |||
| + | Quelle((http:// | ||
| + | |||
| + | ===== Why this is happening ===== | ||
| + | |||
| + | This is a common problem if you do a mysql import and overwrite the mysql database itself, such as when you might be restoring from a mysqldump -A backup. | ||
| + | |||
| + | This is a good thing: you probably want to back up all your mysql users, permissions, | ||
| + | |||
| + | Although this new database will possibly change both the root password and the debian-sys-maint password, of course it won't automatically change the expected debian-sys-maint password in / | ||
| + | |||
| + | ===== Resetting the mysql root password (optional) ===== | ||
| + | |||
| + | |||
| + | First things first. If the mysql root password was different between old and new servers, you can use mysqladmin to fix it: | ||
| + | |||
| + | < | ||
| + | |||
| + | However, when you apt-get installed mysql-server, | ||
| + | |||
| + | ===== Fix the debian sys maint password. ===== | ||
| + | |||
| + | So now look up the debian sys maint password that debian created for you when you installed it on the new server. (You need sudo because this should be a highly protected file.) | ||
| + | |||
| + | < | ||
| + | |||
| + | Now, log in to mysql using the root password you set above: | ||
| + | |||
| + | < | ||
| + | |||
| + | Reset the password for the debian-sys-maint user and don't forget to flush privileges: | ||
| + | < | ||
| + | > SET PASSWORD FOR ' | ||
| + | > FLUSH PRIVILEGES; | ||
| + | > QUIT | ||
| + | </ | ||
| + | |||
| + | Test to be sure it works: | ||
| + | |||
| + | < | ||
| + | |||
| + | |||