[英]What would be the minimum priveledges required to check/fix crashed MySQL tables
I'm using the mysqlcheck command for an automated script. 我将mysqlcheck命令用于自动化脚本。 I want to give, the user running the script, the minimum permissions required to be able to successfully run the command with the --all-databases and --repair arguments.
我想给运行脚本的用户提供使用--all-databases和--repair参数成功运行命令所需的最低权限。
A quick excerpt from the documentation page of mysqlcheck
: 摘自
mysqlcheck
的文档页面:
mysqlcheck
uses the SQL statementsCHECK TABLE
,REPAIR TABLE
,ANALYZE TABLE
, andOPTIMIZE TABLE
in a convenient way for the user.mysqlcheck
以一种方便用户的方式使用SQL语句CHECK TABLE
,REPAIR TABLE
,ANALYZE TABLE
和OPTIMIZE TABLE
。
The documentation page of CHECK TABLE
specifies: CHECK TABLE
的文档页面指定:
To check a table, you must have some privilege for it.
要检查表,您必须具有一些特权。
The documentation pages of REPAIR TABLE
, ANALYZE TABLE
, and OPTIMIZE TABLE
specify: REPAIR TABLE
, ANALYZE TABLE
和OPTIMIZE TABLE
的文档页面指定:
This statement requires
SELECT
andINSERT
privileges for the table.该语句需要对该表具有
SELECT
和INSERT
特权。
I think the conclusion is obvious: grant the user only the SELECT
and INSERT
global privileges to be able to successfully run mysqlcheck --repair --all-databases
. 我认为结论很明显:仅向用户授予
SELECT
和INSERT
全局特权 ,才能成功运行mysqlcheck --repair --all-databases
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.