Mysql - Solve the problem of Access denied for user ''@'localhost' to database 'mysql'

Reference link: http://blog.sina.com.cn/s/blog_40aff6390100jeke.html
The steps are as follows:
1: CMD to the Mysql installation directory, mine is: G:\j2ee\mysql-5.6.17-winx64\mysql -5.6.17-winx64\bin
2: Execute: mysqld --defaults-file="G:\j2ee\mysql-5.6.17-winx64\mysql-5.6.17-winx64\my-default.ini" --console --skip-grant-tables
- where my-default.ini is MySQL's own file
3: mysql -u root mysql
4: UPDATE user SET Password=PASSWORD('123') where USER='root';

mine is successful !

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326457492&siteId=291194637