Sunday, December 14, 2014

MYSQL Server - Root password cannot login how!

/etc/init.d/mysql stop

Create a text file
UPDATE mysql.user SET Password=PASSWORD('XXX') WHERE User='root';
FLUSH PRIVILEGES;

Start MySQL in safe mode with init file
mysqld_safe --init-file=/path/of/your/file

Stop and start the mysql server and you should be able to login!
:)

No comments: