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