I'm using the mysqlcheck command for an automated script. 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.
Asked
Active
Viewed 129 times
1 Answers
0
A quick excerpt from the documentation page of mysqlcheck
:
mysqlcheck
uses the SQL statementsCHECK TABLE
,REPAIR TABLE
,ANALYZE TABLE
, andOPTIMIZE TABLE
in a convenient way for the user.
The documentation page of CHECK TABLE
specifies:
To check a table, you must have some privilege for it.
The documentation pages of REPAIR TABLE
, ANALYZE TABLE
, and OPTIMIZE TABLE
specify:
This statement requires
SELECT
andINSERT
privileges for the table.
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
.

axiac
- 68,258
- 9
- 99
- 134