ERROR 1290:The MySQL server is running with the --secure-file-priv option
MYSQL匯出資料包錯”ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement”
在使用SELECT...INTO OUTPUT匯出資料時出現如下的報錯:
root@localhost [team]>select * from team.player into outfile "/tmp/sql/player.txt";
ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
透過報錯的提示可以發現是由於secure-file-priv變數的設定所引起的,檢視該變數的設定,預設的路徑是/var/lib/mysql-files/
root@localhost [team]>show 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.01 sec)
說明:
secure_file_prive=null 限制mysqld 不允許匯入匯出
secure_file_priv=/var/lib/mysql-files/ 限制mysqld的匯入匯出只能發生在/var/lib/mysql-files/目錄下
secure_file_priv=' ' 不對mysqld的匯入匯出做限制
解決方法:
修改secure_file_prive的值或者是按照預設的路徑進行匯出;
windows下在my.ini檔案 [mysqld]節點 下新增secure_file_priv='',然後重啟mysql服務。linux下 在 /etc/my.cnf中新增secure_file_priv=''。
1、我選擇前者修改預設的路徑
[root@seiang mysql]# vim /etc/my.cnf
[mysqld]
secure_file_priv=''
2、重新啟動mysql服務
[root@seiang mysql]# systemctl restart mysqld.service
3、再次檢視該變數取值為NULL
root@localhost [team]>show variables like '%secure%';
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 2
Current database: team
+--------------------------+-------+
| Variable_name | Value |
+--------------------------+-------+
| require_secure_transport | OFF |
| secure_auth | ON |
| secure_file_priv | |
+--------------------------+-------+
3 rows in set (0.13 sec)
4、再次執行匯出操作,成功
root@localhost [team]>select * from team.player into outfile "/tmp/player.txt";
Query OK, 3 rows affected (0.00 sec)
作者:SEian.G(苦練七十二變,笑對八十一難)
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31015730/viewspace-2152273/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ERROR 1290 (HY000): The MySQL server is running withErrorMySqlServer
- MySQL 報錯 ERROR 1290 (HY000): running with the --secure-file-privMySqlError
- Linux:ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannLinuxErrorMySqlServer
- ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables optErrorMySqlServer
- mysqldump Got error 1290MySqlGoError
- 【MySQL】ERROR 1290 (HY000): --secure-file-priv--匯出報錯MySqlError
- Error running ‘Application’Command line is too longErrorAPP
- ERROR 1290 (HY000) 解決辦法Error
- zabbix-server is not running 報錯解決Server
- mysql 5.7.21 CMake Error: The source directory "/data/server/mysql" does not appear to contain CMakMySqlErrorServerAPPAI
- mysqldump: Error 2013: Lost connection to MySQL server during query when dumpingMySqlErrorServer
- MySQL報錯ERROR 2013 (HY000): Lost connection to MySQL server during queryMySqlErrorServer
- ERROR 2013 (HY000): Lost connection to MySQL server at 'reading authorization paErrorMySqlServer
- mysqldump: Error: Binlogging on server not activeMySqlErrorServer
- Microsoft SQL Server, Error: 15128 ()ROSSQLServerError
- MySQL 8.0.12 --secure-file-priv 資料匯出問題解決MySql
- 錯誤內容:You have an error in your SQL syntax; check the manual that corresponds to your MySQL serverErrorMySqlServer
- RPC:authentication error:why = server rejected credentialRPCErrorServer
- 網站報錯:“Database Server Error”網站DatabaseServerError
- psql: error: could not connect to server: No such file or directorySQLErrorServer
- 記一次android app啟動錯誤 Error running :Default Activity not foundAndroidAPPError
- Linux安裝mysql出現ERROR! The server quit without updating PID file問題解決LinuxMySqlErrorServerUI
- mysql Unknown error 1054MySqlError
- MySQL:Lost connection to MySQL server at 'readingMySqlServer
- linux下連線mysql報錯ERROR 2002 (HY000): Can‘t connect to local MySQL server through socket ‘/var/lib/mysqLinuxMySqlErrorServer
- MySQL error 錯 誤 碼MySqlError
- DreamJudge-1290-日期差值
- MySQL Server Startup ScriptMySqlServer
- Mysql修改server uuidMySqlServerUI
- MySQL: Couldn't execute 'SET OPTION SQL_QUOTE_SHOW_CREATE=1MySql
- 1002 Running Median
- HTTP 錯誤 500.21 - Internal Server Error 解決方案HTTPServerError
- HTTP 錯誤 500.19 - Internal Server Error v4.0.30319HTTPServerError
- error:14090086:SSL routines:ssl3_get_server_certificateErrorServer
- MongoDB server returned error on SASL authentication step: BSON field 'saslCoMongoDBServerError
- 【Modelsim常見問題】# ** Error (suppressible): (vsim-12110) All optimizations are disabled because the -novopt option is in effect.Error
- MySQL error log和bin logMySqlError
- Dr.Elephant mysql connection errorMySqlError