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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- MySQL 報錯 ERROR 1290 (HY000): running with the --secure-file-privMySqlError
- ERROR 1290 (HY000): The MySQL server is running withErrorMySqlServer
- Mysql 報The MySQL server is running with the --secure-file-priv option so it cannot execute this stat...MySqlServer
- 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】Slave_SQL_Running: No:Last_Error: Error :1032/1062MySqlASTError
- 【MySQL】ERROR 1290 (HY000): --secure-file-priv--匯出報錯MySqlError
- MySQL 報錯MySQL server syntax to use near 'OPTION SQL_SELECT_LIMIT=DEFAULT'MySqlServerMIT
- 【Mysql】Slave_IO_Running: No---Got fatal error 1236 from masterMySqlGoErrorAST
- ERROR 1290 (HY000) 解決辦法Error
- Error: package MySQL-Cluster-server-gpl is not relocatableErrorPackageMySqlServer
- MysqL錯誤之_ERROR! MySQL server PID file could not be found!MySqlErrorServer
- 【MySQL】Server-id導致Slave_IO_Running: No主從複製故障MySqlServer
- Beego run http server Running on http://:8080GoHTTPServer
- Error: The cluster is not configured or is not running on node NODE_NAMEError
- Error running ‘Application’Command line is too longErrorAPP
- VMWare Server: 511 vmware-serverd service is not runningServer
- mysql 5.7.21 CMake Error: The source directory "/data/server/mysql" does not appear to contain CMakMySqlErrorServerAPPAI
- SQL Error (1130): Host IP is not allowed to connect to this MySQL serverErrorMySqlServer
- Internal Server Error..ServerError
- mysql error 2005 - Unknown MySQL server host 'localhost'(11001)MySqlErrorServerlocalhost
- Understanding How to Set the SQL Server I/O Affinity OptionSQLServer
- MySQL 5.5 原始碼安裝報錯"[ERROR] Can't start server"MySql原始碼ErrorServer
- MySQL 8.0.12 --secure-file-priv 資料匯出問題解決MySql
- 釋出android apk,Error running app: No target device found.AndroidAPKErrorAPPdev
- MySQL報錯ERROR 2013 (HY000): Lost connection to MySQL server during queryMySqlErrorServer
- ERROR! The server quit without updating PID file (/opt/mysql/mysql/data/cvs.pid)ErrorServerUIMySql
- FATAL ERROR IN TWO-TASK SERVER: error = 12569ErrorServer
- MySQL報錯'ERROR 2002 (HY000): Can't connect to local MySQL server through'MySqlErrorServer
- Xtrbackup 備份過程報錯 Error: option 'datadir' has different values:Error
- FATAL ERROR IN TWO-TASK SERVER: error = 12152ErrorServer
- 求助:weblogic8.1 : Error 500--Internal Server ErrorWebErrorServer
- SQL Server-聚焦什麼時候用OPTION(COMPILE)呢?SQLServerCompile
- mysqldump: Error 2013: Lost connection to MySQL server during query when dumpingMySqlErrorServer
- mysqldump: Got error: 2002: Can't connect to local MySQL server through.....MySqlGoErrorServer
- 錯誤內容:You have an error in your SQL syntax; check the manual that corresponds to your MySQL serverErrorMySqlServer
- Microsoft SQL Server, Error: 15128 ()ROSSQLServerError