Solve the problem of Access denied for user ''@ 'localhost' to database 'mysql', deniedlocalhost
After modifying the root user password of mysql, log on again, and the system prompts an error such as the title. After finding the answer, the solution is finally completed. The steps are as follows:
1. stop mysql: service mysqld stop
2. log on to mysql using the unverified status:
Mysqld_safe -- skip-grant-tables & // run in the background
Start mysql: service mysqld start
3. Go to mysql: mysql-u root
4. use mysql;
5. delete from user where user = ''; delete empty users
6. flush previlige; refresh Permissions
7. service mysqld restart
8. Problem Solving
An error occurred while connecting to MySQL using JAVA: Access denied for user ''@ 'localhost' to database 'qquser'
Obviously, you have no permissions.
ERROR 1044 (42000): Access denied for user ''@ 'localhost' to database' mysql
You can see that the database name is the user table in the mysql database.
Check whether the root user's create_priv permission is set to N?
I don't know if there are too many connected users?