3. Add Users:
(Note: Unlike the above, the following is because it is a command in a MySQL environment, so it is followed by a semicolon as a command terminator)
Format: Grant Select on database. * To User name @ login host identified by "password"
The first type:
Add a user test1 password to ABC so that he can log on on any host and have access to queries, insertions, modifications, and deletions to all databases. First, use the root user to connect to MySQL, and then type the following command:
Grant Select,insert,update,delete on * * to [e-mail protected] "%" identified by "ABC";
But the increase of the user is very dangerous, you want to like someone knows test1 password, then he can be on any computer on the Internet to log on to your MySQL database and to your data can do whatever you like, the solution see the second kind of example:
The first kind: Add a user test2 password for ABC, so that he can only login on localhost, and can query, insert, modify, delete the database mydb (localhost refers to the local host, that is, the MySQL database host), This allows the user to use a password that knows test2, and he cannot access the number directly from the Internet.
Mysql> Grant Select,insert,update,delete on book.* to [e-mail protected] identified by "ABC";
If you do not want to test2 have a password, you can call another command to erase the password.
Mysql> Grant Select,insert,update,delete on book.* to [e-mail protected] identified by "";
MySQL Add user