1. # /etc/init.d/mysqld stop

2.  Start MySQL server without password:

# mysqld_safe –skip-grant-tables &

3. # 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. # /etc/init.d/mysqld stop

8. # /etc/init.d/mysqld start

Now you can access your mysql service by using

# mysql -u root -p

Leave a Reply

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