MySQL database set remote access permissions method summary

Source: Internet
Author: User

Http://www.jb51.net/article/42441.htm

MySQL Basics first, how to remotely access 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 CodeThe code is as follows:
Mysql>grant all privileges in test.* to ' root ' ('% ');

Description: Set the user name to root, the password is empty, access to the database test

2, set access to all database permissions

Copy CodeThe code is as follows:
Mysql>grant all privileges on * * to ' root ' @ '% ';

Description: Set user name to root, password is empty, access all databases *

3, set the specified user name access rights

Copy CodeThe code is as follows:
Mysql>grant all privileges on * * to ' liuhui ' @ '% ';

Description: Set the specified user name to Liuhui and the password to be empty to access all databases *

4. Set Password access rights

Copy CodeThe code is as follows:
Mysql>grant all privileges on * * to ' liuhui ' @ '% ' identified by ' Liuhui ';

Description: Set the specified user name to Liuhui, password to Liuhui, and access to all databases *

5, set specify accessible host permissions

Copy CodeThe code is as follows:
Mysql>grant all privileges on * * to ' liuhui ' @ ' 10.2.1.11 ';

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

You can also set the specified access to a data table under a database and continue to follow the MySQL Basics series.

MySQL database set remote access permissions method summary

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.