- /etc/init.d/mysql stop
- mysqld_safe —user=mysql —skip-grant-tables —skip-networking &
- mysql -u root
- mysql> flush privileges;
- mysql> ALTER USER ‘root’@‘localhost’ IDENTIFIED BY ‘newpassword’;
- mysql> quit;
- /etc/init.d/mysql restart
- mysql -u root -p # newpassword