Usage of the Mysql permission table _ MySQL

Source: Internet
Author: User
Usage summary of Mysql permission table bitsCN.com
A problem occurred a few days ago when I used the Mysql permission table. My msql permission table (mysql. user): Localhsot User Password % root * login root * 81F5E21E35407D884A6CD4A731AEBFB6AF209E1Blocalhost xxw: 1 root * login bogon then, I log on to the server from localhost> mysql-u root-p. The password is entered correctly, but the ERROR message is: ERROR 1045 (28000 ): access denied for user 'root' @ 'localhost' (using password: YES ). after querying the official documentation, it was originally related to the storage rules and sorting rules of the permission table. System: storage rule: if the User field is not empty, it must be strictly matched. if the User field stores a null value, it matches all users. In addition, if no user is specified in the connection information, or the value is null after-u, the system considers that a user does not provide a user name for access, so all user names can be matched. sorting rules: when a permission table is read into the memory, it is sorted by the limited range. the more detailed the limit is, the more advanced it is. First, sort by Host field. if the Host is the same, sort by User field. Therefore, if there is a connection information input, it is matched according to the read memory order, rather than matching according to the database rules. Looking back at the example above, after reading the memory, the permission table is sorted as follows: localhost xxw localhost bogon root * Handle: 1 root * handle % root * handle according to the above rules, matching the second. The password of this rule is blank, but I entered the password of the last storage, so login failed. However, the Mysql prompt is indeed misleading, so that the user thinks it is matched to the last .bitsCN.com

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.