How to restore MySQL password
If you forget the MySQL root password, you can reset it in the following ways:
1. Kill off the MySQL process in the system;
Killall-term mysqld
2. Use the following command to start MySQL, to do not check the permissions of the way to start;
Safe_mysqld--skip-grant-tables &
3. Then use the null password method to log in to MySQL with root user;
Mysql-u Root
4. Change the password of root user;
mysql> Update Mysql.user Set Password=password (' New password ') where user= ' root ';
mysql> flush Privileges;
Mysql> quit
Restart MySQL and you can log on with the new password.
MySQL Password reset method
Mysqladmin-u root-p Password mypasswd
After entering this command, you need to enter the original password for root, and then the root password will be changed to MYPASSWD.
Change the command root to your username, and you can change your password.