select * from server into outfile /tmp/tt.txt ; ERROR 1045 (28000): Access denied for user chenliang @ % (using pass..."/>
溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

【Mysql】into outfile報錯的問題

發(fā)布時間:2020-08-06 18:22:12 來源:ITPUB博客 閱讀:354 作者:小亮520cl 欄目:MySQL數(shù)據(jù)庫
明明有select 權(quán)限卻報錯
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)還是報錯
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
--這次錯誤不一樣了,這個錯誤是一個參數(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)


這個參數(shù)我以前在5.6.24版本都沒調(diào)整過,可能默認(rèn)值就是‘’,高版本默認(rèn)值改成null,所以一定要注意
向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI