MySQL user permission setting method

Source: Internet
Author: User
Tags mysql query

To learn about MySQL databases, you must first set MySQL user permissions. The following describes how to set MySQL user permissions.

1. Log On As the root user or another user with MySQL user permissions.
2. The following command creates a test user with the password test and can only operate on the picture database.
Mysql> grant all on picture. * TO test identified by "test ";

The syntax of the GRANT statement looks like this:
GRANT privileges (columns) ON what TO user identified by "password" WITH GRANT OPTION

To use this statement, you must enter the following parts:
Privileges grants MySQL user permissions. The following table lists the MySQL user permission specifiers that can be used for GRANT statements:
Operation permitted by the permission specified character
Alter table and Index
Create Database and table Creation
Delete existing records in the table
Drop discard delete) databases and tables
Create or discard an INDEX
Insert a new row into the table
REFERENCE unused
Select to retrieve records in a table
Update modify existing table records
FILE: reads or writes files on the server.
PROCESS: View information about the thread executed on the server or kill the thread.
RELOAD: RELOAD the authorization table or clear logs, host caches, or table caches.
SHUTDOWN the server
ALL; all privileges Synonyms
USAGE special "no permission" permission

The table above shows that the permission specifiers in the first group apply to databases, tables, and columns, and the second group manages permissions. Generally, these are relatively strictly authorized because they allow users to affect server operations. The third group has special permissions. "ALL" means "ALL Permissions", and "UASGE" means "no Permissions", that is, creating users, but not granting permissions.

Troubleshooting of MySQL query timeout

How to delete duplicate records in MySQL

About MySQL query Cache Mechanism

Use MySQL temporary tables to accelerate queries

How to properly use MySQL Indexes

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.