Data Control Language (DCL)

Source: Internet
Author: User
Tags mysql in
Data Control Language (DCL) permissions in MySQLIn MySQL, permissions are some of the system's default "nouns" (words), about 30, each of which indicates "what work can be done." Assigning permissions is equivalent to what a user can do. The main permissions are as follows:

user information from MySQL in MySQL is stored in the user table of the system database MySQL: (You can also query its corresponding permissions)

Use MySQL;
SELECT Host,user,password from user;

Create a user syntax form:

Create user ' username ' @ ' allows its login address ' identified by ' password '; Description: The user you create needs to specify at what address the user can log on. Where "%" stands for "any address". After the user is created, a record is automatically added to the MySQL user table, but the user does not have permission. Remove the user 's drop user ' username ' @ ' allow it to log on to the address '; permission Assignment

Grant permission name 1, permission Name 2, ... on database name. Object name to ' username ' @ ' allows its login address ' identified by ' password '; Description: The permission name is: ' SELECT ', ' Update ', ' delete ', and so on. Where all means "all permissions," or all privileges. Object Name: is a database of "loaded" things, tables are the most common, but also can be views, stored procedures, storage functions and so on. of which: *. * Represents a database name for all objects in all data. * represents all objects in the database-this is commonly used commercially. Identified by ' password ' is used to give a user at this time to modify the password, do not write also can, that does not modify the password. However, the statement can also create a user (if it does not exist), but at this point identified by ' password ' must be written. Delete Permissions

Revoke permission name 1, permission Name 2, ... on database name. The object name from ' username ' @ ' allows its login address ';

Indicates that some permissions are "canceled" from a user (and perhaps other permissions are retained).

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.