MySQL create user two times authorization

Source: Internet
Author: User
Tags mysql create mysql manual mysql create user

Mysql> GRANT All privileges on * * to ' monty ' @ ' localhost '

- identified by ' Some_pass ' with GRANT OPTION;

Mysql> GRANT All privileges on * * to ' monty ' @ '% '

- identified by ' Some_pass ' with GRANT OPTION;

Mysql> GRANT reload,process on * * to ' admin ' @ ' localhost ';

Mysql> GRANT USAGE on *. * to ' dummy ' @ ' localhost ';

The account created with the GRANT statement has the following properties:

• Two of these accounts have the same username Monty and password Some_pass. Two accounts are super user accounts with full privileges to do anything. An account (' Monty ' @ ' localhost ') is only used when connecting from the local computer. Another account (' Monty ' @ '% ') can be used to connect from other hosts. Please note that Monty's two accounts must be able to connect to Monty from any host. Without a localhost account, the anonymous user account for localhost created by mysql_install_db will be preempted when Monty is connected from the local computer. As a result, Monty will be treated as an anonymous user. The reason is that the host column value of the anonymous user account is more specific than the ' Monty ' @ '% ' account, which is preceded by the user table sort order. (The user table sorts the discussion to refer to the MySQL manual).

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.