mysql文件的导入和导出路径有默认的设置,secure-file-priv
show variables like ‘%secure%’;
+--------------------------+-----------------------+
| Variable_name | Value |
+--------------------------+-----------------------+
| require_secure_transport | OFF |
| secure_auth | ON |
| secure_file_priv | /var/lib/mysql-files/ |
+--------------------------+-----------------------+
secure-file-priv的值有三种情况:
secure_file_prive=null ––限制mysqld 不允许导入导出
secure_file_priv=/path/ – --限制mysqld的导入导出只能发生在默认的/path/目录下
secure_file_priv='' – --不对mysqld 的导入 导出做限制
select * from table_name into outfile '/var/lib/mysql-files/28.xls';