Mysql導出導入數據到文件 ERROR 1290

問題

Mysql命令臺導出導入數據報錯:

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

原因

mysql的secure_file_priv這個選項沒有開啓,或者設置了指定的文件路徑,只有在這個路徑下的文件才能導入導出mysql。

解決方法

1.使用命令行查詢mysql 的secure_file_priv值

show variables like "secure_file_priv";

secure_file_priv的值以及含義:

secure_file_priv值 含義
NULL 禁止文件的導入導出
'' 允許所有文件的導入導出
路徑地址 只有該路徑地址下的文件可以導入導出到mysql

2.找到mysql安裝包下的my.ini文件,然後在[mysqld]這個選項下加入或者修改變量secure_file_priv,根據自己的情況設置值,如:

secure_file_priv=''

3.重啓mysql服務

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