報錯error1290 : The MySQL server is running with the –secure-file-priv .....#Olivia丶長歌#
阿新 • • 發佈:2019-01-25
在資料庫運維工作過程中,做資料測試,需要大量資料,對資料進行造數、翻數時,會遇到報錯
ERROR 1290 (HY000): The MySQL server is running with the –secure-file-priv option so it cannot execute this statement.
這是因為沒有設定MySQL的預設匯出路徑。
1,先檢視一下mysql的預設匯出路徑是否開啟
mysql> show variables like '%secure%';
+------------------+-------+
| Variable_name | Value |
+------------------+-------+
| secure_auth | ON |
| secure_file_priv | |
+------------------+-------+
MySQL例項並未開啟匯出路徑。
解決方法,可有找到MySQL的配置未見my.conf(liunx環境),在【mysqld】下面新增一行
secure-file-priv='/'
設定MySQL的預設匯出路徑為根目錄
然後重啟MySQL例項。
mysql> show variables like '%secure%';+------------------+-------+
| Variable_name | Value |
+------------------+-------+
| secure_auth | ON |
| secure_file_priv | / |
+------------------+-------+
2 rows in set (0.00 sec)
這時再執行翻數指令碼就不會報錯了!