#select and insert statements are the minimum MySQL user permissions required to allow optimization and repair.
You can grant insert and select permissions to users using the following syntax -
grant insert,select on yourDatabaseName.* to 'yourUserName'@'localhost';
First, this is the query that creates the user -
mysql> create user 'Emma'@'localhost' identified by 'Emma123'; Query OK, 0 rows affected (0.26 sec)
This is the one that funds the above user Query -
mysql> grant insert,select on web.* to 'Emma'@'localhost'; Query OK, 0 rows affected (0.21 sec)
Here is the query to display all authorizations for the above user -
mysql> show grants for 'Emma'@'localhost';
This will produce the following output -
+-------------------------------------------------------+ | Grants for Emma@localhost | +-------------------------------------------------------+ | GRANT USAGE ON *.* TO `Emma`@`localhost` | | GRANT SELECT, INSERT ON `web`.* TO `Emma`@`localhost` | +-------------------------------------------------------+ 2 rows in set (0.00 sec)
The above is the detailed content of What are the minimum MySQL user permissions to allow optimization and repair?. For more information, please follow other related articles on the PHP Chinese website!