up one level
---
2015-07-01

How to Reset a Linux Server’s MySQL Server Root Password

1. login as linux root user.
2. run command:
service mysql stop
3. run command:
/etc/init.d/mysqld –user=mysql –skip-grant-tables &
4. hit ctrl+c to get back to command prompt
5. login to mysql server with this command:
mysql
6. (now in the mysql monitor) run these commands:
mysql> UPDATE mysql.user SET Password=PASSWORD(‘MyNewPass’)
->                   WHERE User=’root’;
mysql> FLUSH PRIVILEGES;
7. exit the mysql monitor to get back to the linux command line.
8. restart the linux server so that the MySQL server becomes restarted as usual

resources:
http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html
http://www.mysqlab.net.../id/4923

a food image:




[2019 edit: Moved to: https://investorworker.com/2015/... .html.]