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).