My colleague's MySQL database password has been forgotten. I checked my database online and tried it on my machine. The results and results of my database were no longer accessible. I was so depressed! My database was good. There were a bunch of tables in it, and there was no backup !! Please be careful next time. Make a backup before you do not know what to do !! A painful lesson: _____________________________________________________________________________________________________________________________________ error message about forgetting the MySQL Root User Password:
Java. SQL. sqlexception: Access denied for user 'root' @ 'localhost' (using password: Yes )'
And
If you forgetMySQLOfRootUserPasswordYou can perform the following operations (Linux):
If MySQL is running, killall-term mysqld is first killed.
Start MYSQL: Bin/safe_mysqld -- skip-grant-tables
Mysql-uroot can be accessed without a password.
Then
> Use MySQL
>
Update
User SET Password = PASSWORD ("new_pass") where user = "root ";
> Flush privileges;
Kill MySQL again and start MySql in a normal way.