The best use of the MySQL password to forget the solution, after testing, if not successful general is your MySQL run abnormal
Solution:
Under Windows:
Copy Code code as follows:
Open the Command Line window to stop the MySQL service:
Net stop MySQL
Start MySQL, general to the installation path of MySQL, find Mysqld-nt.exe
Execution: mysqld-nt--skip-grant-tables The current window will stop.
Also open a command line window, execute MySQL If prompted without this command, first go to MySQL installation location under the Bin directory and then run MySQL
>use MySQL
>update User Set Password=password ("New_password") where user= "root";
>flush privileges;
>exit
With Ctrl+alt+del, find the mysqld-nt process kill it, restart the Mysql-nt service, you can log in with the new password
under Linux:
Copy Code code as follows:
If MySQL is running, first kill: Killall-term mysqld.
Start Mysql:bin/safe_mysqld--skip-grant-tables &
You can enter MySQL without the need for a password.
Then it's
>use MySQL
>update User Set Password=password ("New_pass") where user= "root";
>flush privileges;
Re-kill MySQL, start in normal way