-
-
[Resolved as follows (note cmd command window must be opened as an administrator)]
-
mysql password is forgotten once this error.
Access denied for user'root'@'localhost' (using password: NO或者YES)
1. stopped mysql services: net stop mysql
(At this show, mysql server is stopped
mysql server is stopped. )
2. skip to enter a password:
mysqld --defaults-file = "D: \ mysql \ mysql-5.6.45-winx64 \ my-default.ini" --console --skip-grant-tables (path in double quotes according to their own situation to find it) run
If the code line by line jump is successful.
3. Do not close the command line window, open another command line window to log mysql server, then enter the command: mysql -u root -p do not need to enter a password just press Enter, direct access to the mysql server.
4. Enter the command entered: use mysql
5.update mysql.user set password (pay attention here, because I was so used this 5.6, other versions may check) = password ( 'Enter the password to be changed, do not copy the phrase Chinese') where host = 'localhost ';
6 Refresh permissions: flush privileges;
7. At this point two cmd command may close window, then re-open a window command to restart mysql service,
8. reuse and modify the root password to: mysql -u root -p and enter the password validation, successfully entered shows a success.