MySQL - The MySQL server is running with the --secure-file-priv option

今天嘗試使用 into outfile 導出數據的時候出現錯誤:

The MySQL server is running with the --secure-file-priv option so it cannot execute this statement

上網查了一下,應該是 MySQL 設置的權限,可以使用

# 查看 secure-file-priv 當前的值是什麼
show variables like '%secure%'; 

導出的數據必須是這個值的指定路徑纔可以導出,默認有可能是NULL就代表禁止導出,所以需要設置一下。

知道MySQL安裝路徑下的my.ini文件,設置一下路徑。

然後重啓數據庫即可。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章