Recently, a user was created. However, an error message appears when you log in:
ERROR 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using Password:yes)
Looked up the internet and found the cause of the problem. When the database is installed, there is an anonymous user who is empty, and this user is empty it can match any character . As (fourth):
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/7E/68/wKioL1b-U2WQe3K4AAAzsU4IWcg027.png "title=" 2016-04-01_184938.png "alt=" Wkiol1b-u2wqe3k4aaazsu4iwcg027.png "/>
And the user I created is:
Mysql> Grant all on itcase.* to ' test ' @ ' percent ' identified by ' 123456 ';
The error 1045 (280000) prompt appears when you log on. The wildcard character% in the Create command can match all characters .
The problem is clear when I enter the login command:
c:\users\administrator>mysql-utest-p123456
The system will look for the matching field, the user test his host is defined as%, any of the host fields can be. To match the user field, then test matches to the fourth field with a null username. This means that we are logged in with an anonymous user, not the test user we want, and the password validation error. So can't login;
The reason is found, the solution is to delete the anonymous user on the line. Anonymous users are self-given by the system, and they do not have a password, you can easily log in; From a security perspective, deleting anonymous users can also improve the security of your database.
Log in to MySQL with the root user;
mysql> use MySQL;
Database Changed
Mysql>delete from user where user= ';
Query OK, 2 rows affected (0.17 sec)
Mysql>exit
Ok! To resolve this issue.
MySQL Create login error ERROR1045 (28000)