The DCL in MySQL

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.