MySQL permissions operation: Grant, Revoke

Source: Internet
Author: User

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

    1. Usage
    2. Select
    3. Create
    4. Create routine
    5. Create temporary tables
    6. CREATE view
    7. Create user
    8. Insert
    9. Alter
    10. Alter routine
    11. Update
    12. Delete
    13. Drop
    14. Show Database
    15. Show view
    16. Index (Create Reference)
    17. Execute
    18. Lock tables
    19. References
    20. Reload (flush and other operations)
    21. Replication Client
    22. Replication slave
    23. Shutdown
    24. Grant option
    25. File
    26. Super
    27. 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

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.