ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
背景
MySQL在進(jìn)行導(dǎo)出全表數(shù)據(jù)的時候提示ERROR 1290
mysql> select * from student into outfile '/tmp/student.sql';
ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
原因
出現(xiàn)這個問題的原因是mysql的secure_file_prive這個選項沒有開啟,或者這個選擇了特定的文件路徑,只有在這個文件路徑下的文件才能導(dǎo)入導(dǎo)出mysql
解決方法
首先在mysql環(huán)境下查詢secure_file_priv參數(shù)。
mysql> show variables like 'secure-file-priv';
Empty set (0.02 sec)
參數(shù)secure_file_priv的值及含義如下:
secure_file_priv值 | 含義 |
---|---|
NULL | 禁止文件的導(dǎo)入導(dǎo)出 |
‘’ | (空字符串)允許所有文件的導(dǎo)入導(dǎo)出 |
一個特定的路徑地址 | 只有該路徑地址下的文件可以導(dǎo)入導(dǎo)出到mysql |
在my.cnf配置文件里面添加secure_file_prive參數(shù)文章來源:http://www.zghlxwxcb.cn/news/detail-691652.html
[root@mysql conf]# more my.cnf |grep secure_file_priv
secure_file_priv = ''
然后重啟mysql服務(wù)后進(jìn)行導(dǎo)出驗證文章來源地址http://www.zghlxwxcb.cn/news/detail-691652.html
mysql> select * from student into outfile '/tmp/student.sql';
Query OK, 0 rows affected (0.00 sec)
到了這里,關(guān)于ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot exec的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!