1290 – The MySQL server is running with the –secure-file-priv option so it cannot execute this statement
創(chuàng)新互聯(lián)網(wǎng)站建設(shè)公司,提供網(wǎng)站設(shè)計(jì)制作、網(wǎng)站設(shè)計(jì),網(wǎng)頁(yè)設(shè)計(jì),建網(wǎng)站,PHP網(wǎng)站建設(shè)等專業(yè)做網(wǎng)站服務(wù);可快速的進(jìn)行網(wǎng)站開發(fā)網(wǎng)頁(yè)制作和功能擴(kuò)展;專業(yè)做搜索引擎喜愛(ài)的網(wǎng)站,是專業(yè)的做網(wǎng)站團(tuán)隊(duì),希望更多企業(yè)前來(lái)合作!
secure-file-priv特性
secure-file-priv參數(shù)是用來(lái)限制LOAD DATA, SELECT … OUTFILE, and LOAD_FILE()傳到哪個(gè)指定目錄的。
show global variables like '%secure%';
mysql> show global variables like '%secure%';
+------------------+-------+
| Variable_name | Value |
+------------------+-------+
| secure_auth | OFF |
| secure_file_priv | |
+------------------+-------+
2 rows in set (0.00 sec)
有導(dǎo)出權(quán)限,導(dǎo)出路徑需在/var/lib/mysql-files/下:
mysql> show global variables like '%secure%';
+--------------------------+-----------------------+
| Variable_name | Value |
+--------------------------+-----------------------+
| require_secure_transport | OFF |
| secure_auth | ON |
| secure_file_priv | /var/lib/mysql-files/ |
+--------------------------+-----------------------+
3 rows in set (0.09 sec)
MYSQL新特性secure_file_priv對(duì)讀寫文件的影響
此開關(guān)默認(rèn)為NULL,即不允許導(dǎo)入導(dǎo)出。
解決問(wèn)題:
windows下:
修改my.ini 在[mysqld]內(nèi)加入secure_file_priv=
linux下:
修改my.cnf 在[mysqld]內(nèi)加入secure_file_priv=
MYSQL新特性secure_file_priv對(duì)讀寫文件的影響
然后重啟mysql,再查詢secure_file_priv