1. 程式人生 > >mysql 只導出數據不導出結構secure-file-priv error

mysql 只導出數據不導出結構secure-file-priv error

服務 secure bsp stat this data .cn statement sta

在數據庫命令行中只導出數據,不到處數據結構的時候出現secure_file_priv option so it cannot execute this statement的錯誤。

解決方法如下:

1. 新建一個目錄到/path/to/mysql-files 並修改該目錄權限為mysql

2. 然後在my.cnf中配置secure_file_priv=/path/to/mysql-files

3. 重啟mysql服務

4. 在mysql cli中導出文件為 select * from tablename into outfile '/path/to/mysql-files/tablename.data';

5.導出表數據成功。

mysql 只導出數據不導出結構secure-file-priv error