1. 程式人生 > >The MySQL server is running with the --secure-file-priv option

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

ERROR 1290 (HY000) at line 1: The MySQL server is running with the --secure-file-priv option so it cannot execute this statement

SELECT * INTO OUTFILE

ERROR 1290 (HY000) at line 1: The MySQL server is running with the --secure-file-priv option so it cannot execute this statement

執行SELECT * INTO OUTFILE的時候報這個錯誤

Mysql版本

 檢視一下secure_file_priv的數值

show variables LIKE '%secure_file_priv%';

NULL 表示限制mysql 不允許匯入或者匯出

修改mysql配置檔案my.cnf 或 my.ini,在[mysqld]內新增

secure_file_priv = 

(secure_file_priv的值沒有具體值時,mysqld的匯入或匯出不限制檔案目錄)

或者

secure_file_priv = 指定目錄 (限制mysqld 的匯入或匯出只能在指定目錄下)

重啟mysql,再次檢視

ok