SQL DCL Data Control Language, used to define access permissions and security levels;, sqldcl

Source: Internet
Author: User

SQL DCL Data Control Language, used to define access permissions and security levels;, sqldcl

DCL

 

1. Create a user

* Create user username @ IP address identified by 'Password ';

> You can only log on to the specified IP address.

* Create user username @ '%' identified by 'Password ';

> Users can log on to any IP address.

 

2. Authorize the user

* GRANT permission 1 ,... , Permission n ON database. * TO username @ IP Address

> Assign users the specified permissions on the specified database

> For example, GRANTCREATE, ALTER, DROP, INSERT, UPDATE, DELETE, select on mydb1. * TO user1 @ localhost;

* Grant user1 the create, alter, drop, insert, update, delete, and select permissions assigned to the mydb1 database.

* Grant all on database. * TO username @ IP address;

> Assign users all permissions on the specified database

 

3. Revoke authorization

* REVOKE permission 1 ,... , Permission n ON database. * FROM username @ IP address;

> Revoke the specified permissions of a specified user on a specified database

> For example, revoke create, ALTER, drop on mydb1. * FROM user1 @ localhost;

* Revoke the create, alter, and drop permissions of the user1 user on the mydb1 database.

 

4. View Permissions

* Show grants for username @ IP Address

> View permissions of a specified user

 

5. delete a user

* Drop user username @ IP Address

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.