当前位置:   article > 正文

mysql File权限

mysql file权限
想给一个用户File权限,以便实现 SELECT ... INTO OUTFILE ,但是在操作中出错:

root@localhost:mysql.sock[(none)] 15:27:30>GRANT FILE on hx.enjoy TO hx@localhost;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id:    238843282
Current database: *** NONE ***

ERROR 1144 (42000): Illegal GRANT/REVOKE command; please consult the manual to see which privileges can be used

再试下,针对整个库

root@localhost:mysql.sock[(none)] 15:31:22>GRANT FILE ON hx.* TO hx@localhost;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id:    238853936
Current database: *** NONE ***

ERROR 1221 (HY000): Incorrect usage of DB GRANT and GLOBAL PRIVILEGES

还是不行,查阅了一下,在这边看到答案了: http://www.webhostingtalk.com/showthread.php?t=375379

The only priv_type values you can specify for a table are SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, GRANT OPTION, INDEX, and ALTER.

"FILE" is only assigned as a GLOBAL permission

" The EXECUTION, FILE, PROCESS, RELOAD, REPLICATION CLIENT, REPLICATION SLAVE, SHOW DATABASES, SHUTDOWN, and SUPER privileges are administrative privileges that can only be granted globally (using ON *.* syntax)."

原来FILE这种权限属于管理的权限,要赋予用户时,必须要用*.*。
root@localhost:mysql.sock[(none)] 15:31:33>GRANT FILE ON *.* TO hx@localhost;
Query OK, 0 rows affected (0.00 sec)

问题解决
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/你好赵伟/article/detail/976178
推荐阅读
相关标签
  

闽ICP备14008679号