Home > Database > Mysql Tutorial > body text

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

PHPz
Release: 2023-09-15 13:33:08
forward
993 people have browsed it

允许优化和修复的最低 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';
Copy after login

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)
Copy after login

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)
Copy after login

Here is the query to display all authorizations for the above user -

mysql> show grants for 'Emma'@'localhost';
Copy after login

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)
Copy after login

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!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!