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
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)