example, you need to add a user Dee to the 121.52.215.100 connection, the password is 123456, he can only have SELECT permission on the database vshop:
' Dee '@'%'123456'; GRANT SELECT on Vshop. ' Dee '@'%';
To create a user:
Command: CREATE USER ' username ' @ ' host ' identified by ' password ';
Description: Username-the user name that you will create, host-Specifies which host the user can log on to, if localhost is available to local users, you can use the wildcard% if you want the user to be able to log on from any remote host. Password-The user's login password, the password can be empty, if it is empty, the user can not require a password to log on to the server.
Authorized:
Command: GRANT privileges on databasename.tablename to ' username ' @ ' host '
Description: Privileges-user's operation permissions, such as SELECT, INSERT, UPDATE, etc. (see the last side of the article for a detailed list). Use all if you want to grant the permission. DatabaseName-database name, tablename-table name, if you want to grant the user the appropriate operation permissions on all databases and tables, the * representation, such as *. *.
Example: GRANT SELECT, INSERT on Test.user to ' pig ' @ '% ';
GRANT all on * * to ' pig ' at '% ';
Note: A user authorized with the above command cannot authorize another user, and if you want the user to be authorized to do so, use the following command:
GRANT privileges on Databasename.tablename to ' username ' @ ' host ' with GRANT OPTION;
Reference: "MySQL create user and authorization method"
MySQL Create user and authorization