Resetting the MySQL root password…
Februar 3rd, 2009 by Blu:RayNe
A little snippet you may need from time to time
$ /etc/init.d/mysql stop
$ killall mysqld; sleep 5; killall -9 mysqld
$ sudo /usr/bin/mysqld_safe –skip-grant-tables &
$ mysql
mysql> USE mysql;
mysql> UPDATE user SET Password=PASSWORD(‘myNewPAssword’) WHERE Host=‘localhost’ AND User=‘root’;
mysql> exit;
$ /etc/init.d/mysql stop # (no ‘restart’ here or mysql may reload without grant-tables!)
$ /etc/init.d/mysql start
$ killall mysqld; sleep 5; killall -9 mysqld
$ sudo /usr/bin/mysqld_safe –skip-grant-tables &
$ mysql
mysql> USE mysql;
mysql> UPDATE user SET Password=PASSWORD(‘myNewPAssword’) WHERE Host=‘localhost’ AND User=‘root’;
mysql> exit;
$ /etc/init.d/mysql stop # (no ‘restart’ here or mysql may reload without grant-tables!)
$ /etc/init.d/mysql start