Edit /etc/mysql/my.cnf, and add the following line
skip-grant-tables
Restart MySQL service
$ sudo service mysql restart
Login to mysql and modify passwords
$ mysql -u root mysql> UPDATE mysql.user set password = PASSWORD('YOUR NEW PASSWORD') where user = 'root' and host = 'localhost'; mysql> quit
Restart MySQL service
$ sudo service mysql restart
You should be able to login to MySQL with your new password
$ mysql -u root -p
No comments:
Post a Comment