Mysql Database Settings Remote access permission method summary _mysql

Source: Internet
Author: User
MySQL Basics first phase, how to remotely access the MySQL database Set permissions method summary, discuss access to a single database, all databases, specify user access, set access password, specify access to the host.

1, set access to individual database permissions

Copy Code code as follows:

Mysql>grant all privileges in test.* to ' root ' @ '% ';

Note: Set user name as root, password is blank, access to database test

2, set access to all database permissions

Copy Code code as follows:

Mysql>grant all privileges in *.* to ' root ' @ '% ';

Note: Set username root, password is blank, access all databases *

3, set the specified user name access rights

Copy Code code as follows:

Mysql>grant all privileges in *.* to ' liuhui ' @ '% ';

Note: Set the specified user name as Liuhui, the password is blank, access all databases *

4, Set Password access rights

Copy Code code as follows:

Mysql>grant all privileges in *.* to ' liuhui ' @ '% ' identified by ' Liuhui ';

Note: Set the specified user name Liuhui, password is Liuhui, access all databases *

5, setting specify accessible host permissions

Copy Code code as follows:

Mysql>grant all privileges in *.* to ' Liuhui ' @ ' 10.2.1.11 ';

Note: Set the specified user name as Liuhui, access all databases *, only 10.2.1.11 this machine has access

You can also set the specified access to a data table under a database, please continue to focus on the MySQL Basics series.

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.