MySQL-fix access denied for user "@ ' localhost ' to database ' MySQL ' problem

Source: Internet
Author: User
Tags sql error

http://361324767.blog.163.com/blog/static/11490252520124454042468/

First of all, I want to say a word:

I greatly despise the domestic people engaged in it, simply no language, the same is to solve the problem, almost identical, are copied. What's more, the error thrown is: Access denied for user ' root ' @ ' localhost ' to database ' MySQL ', unexpectedly also the other people's solution copied over, but also shameless said: The problem solved, I guess not really to operate.

Here are the solutions I get based on the reference to others:

The problem arises:

After I have finished loading MySQL on CentOS, I throw mysql-sql error (1130) When I use Navicat link: Host IP is isn't allowed to connect to this MySQL server error, specifically resolved Method please refer to my log http://361324767.blog.163.com/blog/static/114902525201232832621498/.

After the problem is resolved, I log in to MySQL, mysql-u root without error, but when executing the following statement:

mysql> use MySQL

To throw the error, refer to the online big copy of the masterpiece as follows:

--------------------------------------------------------------------------------------------------------------- -------------------------------

If you enter MySQL first, enter use MySQL after successful startup, the following error occurred: Access denied for user "@ ' localhost ' to database ' MySQL ' and, lost MySQL can, lose mysql-u root error : Access denied for user ' root ' @ ' localhost ' (using password:no). The reason is: An error occurred while updating the root password yesterday update user set password = ' 123456 ' where user = ' root '//This is wrong, the password is not actually 123456 should be the update user Set password = password (' 123456 ') where user = "root" specific steps: Close MySQL: # service mysqld stop then: # Mysqld_safe--skip-gra Nt-tables start MySQL: # service mysqld start mysql-u root mysql> use MySQL mysql> UPDATE user SET Password=password (' x xx ') WHERE user= ' root '; mysql> flush Privileges; Mysql>\q

--------------------------------------------------------------------------------------------------------------- ------------------------------------------

In accordance with the steps of the big copy of the step by step, without any effect, carefully study the error message in the user ' @ ' localhost ', stating that the user table user= ' information is incorrect, and then perform the update user SET Password=password (" ) WHERE user= ';

Decisiveness has no effect.

Finally, do not allow Anonymous logon, execute the following statement

mysql> Delete from user where user= ';

MySQL > Flush privileges;

Mysql> \q

# Service Mysqld Restart

Problem solving.

------------------------------

In this advice you engage it colleagues, you are a little professional spirit, okay? What do you mean, you know, every question, okay? Do you want to copy it? The face of Chinese it people, China's IT industry has been destroyed in your group of hands.

MySQL-fix access denied for user "@ ' localhost ' to database ' MySQL ' problem

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.