MySQL root Benutzer Passwort ändern?

1 Antwort

Vom Fragesteller als hilfreich ausgezeichnet
Du hättest nur einmal Google befragen müssen .... Changing the MySQL root user password

To reset the password for MySQL you first must create a new file with the following contents:

ALTER USER 'root'@'localhost' IDENTIFIED BY 'PASSWORD';

Where PASSWORD is the new password to be used. Save that file as ~/mysql-pwd.

Next, stop the MySQL daemon with the command:

sudo systemctl stop mysql

With the daemon stopped, issue the command:

sudo mysqld -init-file=~/mysql-pwd

Once your command prompt is returned, restart the MySQL daemon with the command:

sudo systemctl start mysql

You should now be able to log into the MySQL command prompt with the new admin password like so:

mysql -u root -p

https://www.strongdm.com/blog/how-to-change-the-mysql-root-password

Woher ich das weiß:Recherche
Namenloser2020 
Fragesteller
 27.11.2020, 13:26

Habe das gleich gefunden. Leider passiert da nichts. Das Passwort wird nicht geändert. Er übernimmt es nicht

0