To reset your MySQL root password, please follow these steps:

1)root@server [~] /etc/init.d/mysqld stop

2) Start MySQL server without password:

root@server [~] mysqld_safe –skip-grant-tables &

3) root@server [~] mysql

After that you can get the mysql prompt then run the following command

4)mysql >use mysql;

5)mysql >update user set password=PASSWORD(“NEWPASSWORD”)

where User=’root’;

6)mysql > quit

7)root@server [~]/etc/init.d/mysqld stop

root@server [~]/etc/init.d/mysqld start

Now you can access your mysql service by using

[root@server ~]#mysql -u root -p

Leave a Reply

Your email address will not be published. Required fields are marked *