分享、学习、提高
2011/01/17 15:47
文章作者:Enjoy 转载请注明原文链接。
想给一个用户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)

问题解决。
发表评论
表情
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
昵称   密码   游客无需密码
网址   电邮   [注册]
               

验证码 不区分大小写