Original address: Http://www.cnblogs.com/eczhou/archive/2012/07/12/2588187.htmlLinux MySQL new account and permissions settings
1, permission to give
Description: MySQL is deployed on server A, and intranet Host B connects server A with client tools for database operations, requiring server A to give Host B permission to operate MySQL
1.1 Enter MySQL on Server A, assuming that the MySQL account on server A is root:
Mysql-u root-p
and enter the password!
1.2 Giving Host B permission to operate the database
Mysql> Grant Usage on * * to [e-mail protected] identified by ' password ';
Description: Give [email protected] permission to use all databases, log in using username account on host 192.168.0.1, password: password
Mysql> Grant Usage on *. * to username identified by ' password ';
Description: Give username permission to use all databases, log in with username account on all hosts, password: password
Mysql> grant all privileges in newdb.* to [email protected];
Description: Give [email protected] Operation database newdb the highest permissions, on the host 192.168.0.1 using username account login, no password
Example:
Mysql> Grant all privileges on * * to [e-mail protected] identified by ' 123456 ';
Description: Give [email protected] permission to use all databases, log in with the root account on host 192.168.0.1, password: 123456
2, remove the account
mysql> drop user [email protected];
Note: Remove the account root so that the host 192.168.0.1 can no longer use the root user to operate the database on Server A
Linux MySQL Permissions