简体   繁体   English

检查/修复崩溃的MySQL表所需的最低特权是多少?

[英]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 statements CHECK TABLE , REPAIR TABLE , ANALYZE TABLE , and OPTIMIZE TABLE in a convenient way for the user. mysqlcheck以一种方便用户的方式使用SQL语句CHECK TABLEREPAIR TABLEANALYZE TABLEOPTIMIZE 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 TABLEANALYZE TABLEOPTIMIZE TABLE的文档页面指定:

This statement requires SELECT and INSERT privileges for the table. 该语句需要对该表具有SELECTINSERT特权。

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 . 我认为结论很明显:仅向用户授予SELECTINSERT 全局特权 ,才能成功运行mysqlcheck --repair --all-databases

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 MySQL 检查崩溃的表 - MySQL check for crashed table 创建MySQL数据库,用户和授予权限所需的最低权限是多少? - What are the minimum privileges required to create MySQL databases, users, and grant permissions? 在 Kotlin Exposed 中从 MySQL 显示表的等效项是什么 - What would be the eqivalent of show tables from MySQL in Kotlin Exposed 检查数组是否在 MySQL 的记录中的聪明方法是什么? - What would be a smart way to check if an array is in records in MySQL? 为mysql数据库创建新用户并仅授予某些特权 - create new user for mysql database and grant only certain priveledges 使用mysqldump所需的最低特权是什么 - What are the minimum privileges required for using mysqldump mysql 什么会更快 - mysql what would be faster 将选定的记录从MySQL数据库导出到SQLite数据库需要什么命令? - What commands would be required to export selected records from a MySQL database to a SQLite database? 如何修复致命错误:无法打开和锁定特权表:表 '.\mysql\proxies_priv' 被标记为已崩溃并且最后(自动?)修复失败 - How do I fix Fatal error: Can't open and lock privilege tables: Table '.\mysql\proxies_priv' is marked as crashed and last (automatic?) repair failed MySQL查询选择1个表的总和和最小记录 - MySql Query Select sum and minimum record for 1 tables
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM