Analytic

Thursday, May 14, 2009

Mysql - Change Root Password

First stop the Mysql:

/etc/init.d/mysql stop

run this command to start Mysql again:

mysqld_safe –skip-grant-tables

Go to mysql:

mysql -u root mysql

and run this command in Mysql:

mysql> UPDATE user SET Password=PASSWORD('newrootpassword') WHERE User='root';

then this command:

mysql> FLUSH PRIVILEGES;

exit Mysql:

mysql> exit ;

Stop the mysqld service:

killall mysqld

and start that normally:

/etc/init.d/mysql start

That's all.

No comments: