I have changed MYSQL root password with below steps, also i don't have much knowledge in Linux commands but these steps worked for me.
1. First of all, log into the server as root using SSH.
2. Now, stop MySQL service:
Code:
# /etc/init.d/mysql stop
Code:
# mysqld_safe --skip-grant-tables &
Code:
# mysql -u root
Code:
mysql> use mysql; mysql> update user set password=PASSWORD("newpassword") where User='root'; mysql> flush privileges; mysql> quit
Code:
# /etc/init.d/mysql stop
Code:
# /etc/init.d/mysql stop # /etc/init.d/mysql start # mysql -u root -p
Leave a comment: