Database operations:
Create a database, create a table--create
Delete a database, delete a table--drop
Delete table contents--truncate, delete (the latter is inefficient, one row to delete records)
Query database, query table--select
Inserting, updating, deleting--insert into, update, delete (mentioned above)
Modify Table--alter (add, modify, or delete columns)
MySQL various permissions (27 kinds): Refer to Http://www.cnblogs.com/subsir/articles/2568361.html by bazaar
- Usage
- Select
- Create
- Create routine
- Create temporary tables
- CREATE view
- Create user
- Insert
- Alter
- Alter routine
- Update
- Delete
- Drop
- Show Database
- Show view
- Index (Create Reference)
- Execute
- Lock tables
- References
- Reload (flush and other operations)
- Replication Client
- Replication slave
- Shutdown
- Grant option
- File
- Super
- Process
Specify all permissions: allprivileges
=========
Authorization command: Grant
Grant permissions on database object to user [identified by ' PASSWORD '];
Right of withdrawal command: REVOKE
Revoke permissions on the database object from the user;
=========
Description
1. Permissions
The previous 27 kinds of permissions, and all privileges, a total of 28 keywords.
The keywords in the previous 27 permissions can be connected by commas to authorize:
Grant SELECT, INSERT, UPDATE, delete on ...
2. Database objects
Database name + English period + table name
For example, the database object represented by Test.person is the person table under the test database.
Database names, table names can be substituted with an asterisk (*), which means all, such as *. * represents all database objects.
Note: The test found that the database object could not be connected with a comma (,) as a permission.
3. User
User name + host name
For example, [email protected], which means accessing the database from the computer named user account.
The hostname can be used with a wildcard%, for example: 172.18.10.% (IP address is 172.18. All IP addresses in the 10 segment are accessible)
4.IDENTIFIED by
Optional content.
Represents the password required for this authorization.
5. Other options (refer to: http://blog.csdn.net/haiross/article/details/51251571 by Haiross)
[With GRANT OPTION]
Max_queries_per_hour Count
Max_updates_per_hour Count
Max_connections_per_hour Count
Max_user_connections Count
About creating a MySQL User:
1.CREATE USER
After this method is created, you also need to follow through grant authorization.
2.grant
Once the user is created this way, the user has a certain privilege.
Like this way.
3.INSERT into Mysql.user table (tried, but added failed)
About deleting a MySQL User:
DROP user username @ host name;
MySQL permissions operation: Grant, Revoke