Montag, 21. Juni 2010

Reset MySQL root password

I will describe, one way to reset the MySQL root password.

turn off mysql
/etc/init.d/mysql -stop


start mysql without any authentication

mysqld --skip-grant-tables


now you can connect without a password or user

mysql -u root -p


now you can set the new password und flush it

UPDATE mysql.user SET Password=PASSWORD('yournewpassword') WHERE User='root';
FLUSH PRIVILEGES;


open a second terminal and stop the mysql server again

/etc/init.d/mysql stop


if you did that you can start the MySQL server

/etc/init.d/mysql start

Keine Kommentare:

Kommentar veröffentlichen