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 '