Mysql導出數據報“The MySQL server is running with the –secure-file-priv option so it cannot execute this statement”
主要是權限不足造成,使用口令查詢Mysql是否開啓導出功能,並查看數據路徑,在對應路徑下導出數據:
mysql> show variables like '%secure%';
+------------------+----------------------------+
| Variable_name | Value |
+------------------+----------------------------+
| secure_auth | ON |
| secure_file_priv | /var/lib/mysql-files/ |
+------------------+----------------------------+
2 rows in set (0.00 sec)
可以看到導出是打開狀態,數據路徑在/var/lib 下,使用outfile導出數據時,導出路徑也必須是/var/lib下。