明明有select 權(quán)限卻報(bào)錯(cuò)
MySQL> select * from server into outfile '/tmp/tt.txt';
ERROR 1045 (28000): Access denied for user 'chenliang'@'%' (using password: YES)
百度后需要給file權(quán)限
mysql> grant file on *.* to chenliang;
Query OK, 0 rows affected (0.00 sec)
再次導(dǎo)還是報(bào)錯(cuò)
mysql> select * from server into outfile '/tmp/tt.txt';
ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
--這次錯(cuò)誤不一樣了,這個(gè)錯(cuò)誤是一個(gè)參數(shù)導(dǎo)致的
配置文件加入后重啟
secure_file_priv=''
導(dǎo)出成功
mysql> select * from server into outfile '/tmp/tt.txt';
Query OK, 27 rows affected (0.00 sec)
這個(gè)參數(shù)我以前在5.6.24版本都沒(méi)調(diào)整過(guò),可能默認(rèn)值就是‘’,高版本默認(rèn)值改成null,所以一定要注意
新聞名稱:【Mysql】intooutfile報(bào)錯(cuò)的問(wèn)題
地址分享:
http://weahome.cn/article/gjijec.html