You can reset your MySQL root password if you forget that or you are having any issue related to that.

1. First of all, log into the server as root using SSH.

2. Now, stop MySQL service:

# /etc/init.d/mysql stop

3. Start MySQL server without password:

# mysqld_safe --skip-grant-tables &

4. Connect to MySQL:

# mysql -u root

5. Setup new MySQL root password:

mysql> update user set password=PASSWORD("newpassword") where User='root';
mysql> flush privileges;
mysql> quit

6. Stop MySQL Server:

# /etc/init.d/mysql stop

7. Stop and start the MySQL service and test it:

# /etc/init.d/mysql stop
# /etc/init.d/mysql start
# mysql -u root -p


Was this answer helpful? 0 Users Found This Useful (0 Votes)