mysql To authorize a user, such as select,insert,update,delete Wait for one or more of these permissions , The main use of grant command , The format is :

No authorization for users

grant jurisdiction on Database objects to ' user '@' host IP' identified by ' password ';

Authorize existing users

grant jurisdiction on Database objects to ' user '@' host IP';

One 、grant Ordinary users , Inquire about , Insert , to update , The right to delete all tables in the database .

1、 Grant view permission

mysql> grant select on mysql.user to 'ranran'@'localhost';
mysql> flushprivileges;

2、 Grant insert permission

mysql> grant insert on mysql.user to 'ranran'@'localhost';
mysql> flush privileges;

3、 Grant update permission

mysql> grant update on mysql.user to 'ranran'@'localhost';
mysql> flush privileges;

4、 Grant delete permission

mysql> grant delete on mysql.user to 'ranran'@'localhost';
mysql> flush privileges;

5、 View permissions granted

mysql> show grants for 'ranran'@'localhost';
+----------------------------------------------------------------------------------------+
| Grants for ranran@localhost |
+----------------------------------------------------------------------------------------+
| GRANT CREATE, CREATE USER ON *.* TO 'ranran'@'localhost' |
| GRANT SELECT, INSERT, UPDATE, DELETE, CREATE ON `mysql`.`user` TO 'ranran'@'localhost' |
+----------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)

6、 Or insert it with a command

mysql> grant select,insert,update,delete on *.* to 'ranran'@'localhost';

mysql And grant More related articles on permissions

  1. mysql Of grant Permission parameter summary

    Obviously, in total 28 Permissions : The following is a detailed introduction of permissions : Reprinted , Make a note of : One . Permissions on the table mysql In the database 3 A permission table :user .db. host The access process of permission table is : 1) First from user In the table host. use ...

  2. mysql add to grant jurisdiction

    GRANT USAGE ON *.* TO 'xxxx'@'x.%.%.%' WITH GRANT OPTION;

  3. turn : MySQL Give users permission (grant %- Remote and localhost- Local differences )

    Related references : MySQL The simple format of the command to give users permission can be summarized as : grant jurisdiction on Database objects to user One .grant Ordinary data users , Inquire about . Insert . to update . Delete Rights to all table data in the database . gr ...

  4. Mysql grant Rights management

    MySQL The simple format of the command to give users permission can be summarized as : grant jurisdiction on Database objects to user [identified by ' password '] Most commonly used , When it comes to master-slave synchronization , For the slave slave The user is set to have ...

  5. grant all After empowerment mysql.user The table permission field is still N, But you can log in and create new tables

    grant all After empowerment mysql.user The table permission field is still N, But you can log in and create new tables grant all privileges on linuxeye.* to linuxeye@'localhost' i ...

  6. [MySql]GRANT Some of the tricks of authority

    Application '; You can quickly create a table that the user owns SELECT operation : Application SHOW GRANTS FOR 'test_1'@'localhost'; Analyze the user's final GRANT jurisdiction : MySql By default tes ...

  7. mysql grant Authority summary

    2019-01-07 from  https://blog.csdn.net/wulantian/article/details/38230635 One . Permissions on the table mysql In the database 3 A permission table :user .d ...

  8. MySQL Give users permission (grant %- Remote and localhost- Local differences )

    But sometimes ( Some versions )'%' barring localhost, Alone @'localhost' Assign a value , It really caught me , In the face of mysql5.1.32 When setting up a remote user . Respectively for '%' and 'localhost' to grant authorization ...

  9. mysql Give users permission

    # To give permission MySQL> grant Authority parameters on Database name . The name of the table to user name @ Address of the user identified by ' User password '; # Immediate access MySQL> flush pr ...

Random recommendation

  1. spring mvc Interceptor summary in .

    stay spring mvc in , Interceptors are actually simpler , The following is a brief summary and demo Next . preHandle: Preprocessing callback methods , Implement preprocessing of processor ( Such as login check ), The third parameter is the response processor ( As we said in the last chapter Control ...

  2. About Chrome 67 Later versions cannot install the extension offline

    The upgrade Chrome, I suddenly found that there was a problem with the extension management page —— Unable to install extension offline , Drag and drop crx File to this page ,Chrome I've been suggesting “ Can't add app from this site , Extenders and user scripts ”. Pictured : Google from Chrome 67 edition ...

  3. PropertyChangeSupport The application of listener mode

    PropertyChangeSupport Class to implement the listener function , It is java jdk A class of its own , It is used to monitor the change of an object property to trigger the corresponding information , See code introduction for details import java.beans.Pro ...

  4. Some users visit Polycom Video conference failure

    1. The phenomenon Polycom The video conference server is deployed under the firewall , adopt Paloalto One to one mapping of the firewall to the public network . Some colleagues use the workplace network or 4G When accessing through the public network , There was a timeout problem . 2. analysis : Polycom The device didn't do ...

  5. [ National Team ] calc

    Toot toot This question dp It's not hard , But I still didn't push it out , I feel that my brain is not working well recently . So he ran to ask the immortal gjx( Top three in China !) 了 .( It's good to go out for training ) Immortals deserve to be immortals , It came to me in a moment , And the method is better than the online problem solving . d ...

  6. IDA debugging Android Method and simple shelling implementation

    IDA debugging Android Method and simple shelling implementation label : android Original reverse debugging dalvik 2016-05-24 14:24 9286 Human reading Comment on (3) Collection report classification : original (25) An ...

  7. sublime text Common shortcut keys and multi row and column mode batch operation tutorial

    Column mode Apple :OS X - Left mouse button +Option - Or the middle mouse button - Add options :Command, Less choices :Command+Shift 2 Windows: - Right mouse button +Shift - Or the middle mouse button - increase ...

  8. P6 EPPM Installation and Configuration Guide

    In This Section Installation and Configuration Guide Manual Installation Guides P6 Professional Inst ...

  9. Longest common subsequence (LCS) problem

    The longest public substring (Longest Common Substirng) And the longest common subsequence (Longest Common Subsequence,LCS) The difference is : A substring is a continuous part of a string , Subsequences never change order ...

  10. sql The difference between view and table

    Sort out the differences between views and tables difference : 1. The view is compiled sql, Table is not 2. The view has no actual physical storage record , Table has 3. Views are logical concepts , The table can be modified 5. The table is the inner mode , Views are out of mode 6. The view is where we look at the table ...