FAQs about MySQL
Problem 1: the user cannot log on after the user is created on the local machine.
Problem description:
Create a database using root, and specify the user name that the database is allowed to access.
Mysql> create database keystone; mysql> grant all privileges on keystone. * TO 'keystone '@' % 'identified by '000000'; mysql> flush privileges;
Check whether the user can access mysql normally
# Mysql-u keystone-p123456-D keystoneERROR 1045 (28000): Access denied for user 'keystone '@ 'localhost' (using password: YES)
Solution: analyze the authorization statement. All permissions are granted to the user 'keystone '@' % ', and % indicates that access from any IP address is allowed, however, the 'localhost' cannot be parsed '. If you log on to mysql locally on the server, the above error will pop up, 'keystone '@ 'localhost'. The solution is as follows:
Mysql> grant all privileges on keystone. * TO 'keystone '@ 'localhost' identified by '123 ';