mysql> select emp_no,first_name,last_name,gender into outfile '/home/mycat/t1.txt'
-> FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' from employees.t_emp ;
ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
mysql> show variables like '%secure%';
+--------------------------+-------+
| Variable_name | Value |
+--------------------------+-------+
| require_secure_transport | OFF |
| secure_auth | ON |
| secure_file_priv | NULL |
+--------------------------+-------+
3 rows in set (0.00 sec)
修改my.cnf 重启mysql
mysql> show variables like '%secure%';
+--------------------------+--------------+
| Variable_name | Value |
+--------------------------+--------------+
| require_secure_transport | OFF |
| secure_auth | ON |
| secure_file_priv | /home/mysql/ |
+--------------------------+--------------+
3 rows in set (0.00 sec)