DCL (understanding)
* A project to create a user! A project corresponding to the database only one!
* This user can only have access to this database, other databases you will not be able to operate!
1. Create a user
* CREATE user username @ip address identified by ' password ';
> users can only log on to the specified IP address
* CREATE user username @ '% ' identified by ' password ';
> Users can log on at any IP address
2. Authorization to the user
* GRANT permissions 1, ..., Permissions n on database. * To user name @ip address
> Permissions, users, databases
> Assign the user the specified permissions on the specified database
> For example, GRANT create,alter,drop,insert,update,delete,select on mydb1.* to [email protected];
* Assign Create, alter, DROP, INSERT, UPDATE, delete, select permissions to the User1 user on the MYDB1 database
* GRANT all on database. * To user name @ip address;
> Assign all permissions on the specified database to the user
3. Revocation of authorization
* REVOKE permissions 1, ..., Permissions n on database. * FROM username @ip address;
> Revoke a specified user's specified permissions on the specified database
> For example, REVOKE Create,alter,drop on mydb1.* from [email protected];
* Revoke User1 user's create, alter, and drop permissions on the MYDB1 database
4. View Permissions
* SHOW GRANTS for user name @ip address
> View permissions for a specified user
5. Delete a user
* DROP user username @ip address
The DCL in MySQL