Solve the problem of Access denied for user & #39; & #39; @ & #39; localhost & #39; to database & #39; mysql & #39;, deniedlocalhost

Source: Internet
Author: User

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?

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.