Users created in MySQL5.5.18 cannot log on.

Source: Internet
Author: User
Today, the user name created with Grant is quot; DanielWquot;. the user name is "Daniel @ localhostquot;" and is re-created after logon.

Today, the user name created with Grant is quot; DanielWquot;. the user name is "Daniel @ localhostquot;" and is re-created after logon.

I encountered some trouble. Although it was not solved, it was a reminder.

Today, the username created with Grant is "DanielW", and the logon password is incorrect. Create a new one. The username is "Daniel @ localhost", that is, add the host name, flush privileges, and then log out and log on again, successful!

After studying it, I found that "DanielW" is used to create a user host, and "Daniel @ localhost" stores DanielW in the user and localhost stores the user host, this is why I cannot log on, because the default-h in the mysql-u root-p logon is localhost, And the username "DanielW" is created with the wildcard %, this is not recognized by mysql ~ How to log on to this % has not been studied understand, personal opinion, hope to advise ~

========================================================== =

Read the mysql reference manual and find that the added users have the following words:

The two accounts have the same username and password "monty" and "some_pass. Both accounts are superuser accounts and have full permissions to do anything. An account ('monty '@ 'localhost') is only used for connection from the local machine. Another account ('monty '@' % ') can be used to connect from other hosts. Note that the two accounts of monty must be able to connect to monty from any host. There is no localhost account. When monty is connected from the local machine, the anonymous user account of localhost created by mysql_install_db takes the lead. As a result, monty is considered an anonymous user. The reason is that the Host column value of the anonymous user account is more specific than that of the 'monty '@' % 'account, so that it is ranked first in the sorting order of the user table.

So % cannot log on to the Local Machine (try remote login again tomorrow ~)

==========================================

Tested in the morning. % you can log on remotely ~~

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.