Jc-mysql permission Detailed

Source: Internet
Author: User
Tags mysql database mysql view

MySQL database has been applied to many internet companies, MySQL Rights management is very important, reasonable planning MySQL database permissions, security and use of the database is very beneficial. A good standard and habit, do not have a big problem.

Here is the MySQL permission planning Authorization statement:

Authorize JC users to query, insert, UPDATE, and delete the rights to all table data in the native TestDB database by authorizing the following methods:

Grant SELECT on testdb.* to jc@ ' localhost '

Grant insert on testdb.* to jc@ ' localhost '

Grant update on testdb.* to jc@ ' localhost '

Grant Delete on testdb.* to jc@ ' localhost '


Authorize JC users to create, modify, and delete MySQL data table structure permissions

Grant create on testdb.* to jc@ ' localhost ';

Grant alter on testdb.* to jc@ ' localhost ';

Grant drop on testdb.* to jc@ ' localhost ';


Authorize JC users to operate MySQL foreign key permissions

Grant references on testdb.* to jc@ ' localhost ';


Authorize JC users to operate MySQL temporary table permissions

Grant create temporary tables on testdb.* to jc@ ' localhost '


Authorize JC users to manipulate MySQL indexing permissions

Grant index on testdb.* to jc@ ' localhost ';


Authorize JC user to manipulate MySQL view, view source code permissions

Grant CREATE view on testdb.* to jc@ ' localhost ';

Grant Show view on testdb.* to jc@ ' localhost ';


Authorize JC users to administer permissions for a MySQL database:

Grant all privileges on TestDB to jc@ ' localhost ';


Authorize JC users to administer permissions for all databases in MySQL:

Grant all on *.* to jc@ ' localhost ';

The authorized JC user rights can be used on multiple levels respectively.

1. Grant functions on the entire MySQL server:

Grant SELECT on *.* to Jc@localhost; -JC can query the tables in all the databases in MySQL.

Grant all on *.* to Jc@localhost; -JC can manage all databases in MySQL

2. Grant functions on a single database:

Grant SELECT on testdb.* to Jc@localhost; -JC can query the tables in TestDB.

3. Grant functions on a single datasheet:

Grant SELECT, INSERT, UPDATE, delete on testdb.orders to Jc@localhost;

4. Grant acts on the columns in the table:

Grant Select (ID, SE, rank) on Testdb.apache_log to Jc@localhost;

5. Grant functions on stored procedures, functions:

Grant execute on procedure testdb.pr_add to ' JC ' @ ' localhost '

Grant execute on function testdb.fn_add to ' JC ' @ ' localhost '

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.