MySql database prompt: 1045 access denied for user 'root' @ 'localhost' using password YES, mysqldenied
1. Start --> cmd --> net stop mysql (it can be omitted if the MySQL service is disabled but not started)
2. Find my. ini in the installation path MySQL Server 5.1.
3. Open my. ini, find [mysqld], and add
Skip_grant_tables (it seems that the permission table authentication is skipped when the MySQL service is started)
4. Start the database and change the password.
Start --> cmd --> net start mysql (start MySQL Service) ---> mysql press enter (if successful, a MySQL prompt will appear)
5. Enter use mysql; (connect to the permission database ).
6. change password: update user set password = password ("123") where user = "root"; (do not forget the last plus points, before version 5.7, replace the password field with authentication_string after version 5.7)
7. Refresh permission (required): flush privileges ;.
8. Exit quit.
9. Remove skip_grant_tables from step 1 in my. ini (the permission table authentication cannot be skipped when the MySQL service is started)
10. Restart MySQL and enter again. You can log on with the username root and the new password 123 you just set.