执行"SELECT INTO OUTFILE"时拒绝错误访问的mysqldump的适当特权是哪些? [英] Which are the proper privileges to mysqldump for the Error Access denied when executing 'SELECT INTO OUTFILE'.?
问题描述
备份用户具有BackupAdmin角色和ALL特权(对象权限,DDL,GRANT).
backup user has BackupAdmin role and ALL privileges (object rights, DDL, GRANT).
cmd> mysqldump --routines=TRUE --tab=C:\tmp -h localhost -u backup -pbackup schemalocal
cmd> mysqldump: Got error: 1045: Access denied for user 'backup'@'%' (using password: YES) when executing 'SELECT INTO OUTFILE'
使其起作用的唯一方法是将DBA角色赋予备份帐户,但这存在安全隐患,因此我只想赋予它必要的权利. 他们是谁?
The only way to make it work is to give DBA role to backup account, but that is a security risk so I want to give it only the neccesary rights. Which are them?
推荐答案
您需要 FILE
特权才能被允许使用SELECT...INTO OUTFILE
,这似乎是mysqldump --tab
用于生成制表符分隔转储的内容.
You need the FILE
privilege in order to be allowed to use SELECT...INTO OUTFILE
, which seems to be what mysqldump --tab
uses to generate the tab-separated dump.
此特权为全局 ,这意味着只能将其授予"ON *.*
":
This privilege is global, which means it may only be granted "ON *.*
" :
GRANT FILE ON *.* TO 'backup'@'%';
这篇关于执行"SELECT INTO OUTFILE"时拒绝错误访问的mysqldump的适当特权是哪些?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!