Home  >  Article  >  Database  >  What are the minimum MySQL user permissions to allow optimization and repair?

What are the minimum MySQL user permissions to allow optimization and repair?

PHPz
PHPzforward
2023-09-15 13:33:08994browse

允许优化和修复的最低 MySQL 用户权限是多少?

#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!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete