/**
导出数据库的方法:
(1)OUTFILE 应该使用mysql的--secure-file-priv否则会出现:
[Err] 1290 - The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
那么,应该怎么找到--secure-file-priv呢?
1.在mysql命令行中,使用 show variables like '%secure%';
2. secure_file_priv         | C:\ProgramData\MySQL\MySQL Server 5.7\Uploads\ 
选择C:/ProgramData/MySQL/MySQL Server 5.7/Uploads/后边加上你的文件名。
注意:应该是'/'而不是'\'。
然后执行:
select * from employee into outfile "C:/a.txt" fields terminated by "," enclosed by '"'

 fields terminated by "," enclosed by '"'
**/

select * from employee into outfile "C:/ProgramData/MySQL/MySQL Server 5.7/Uploads/a3.txt" fields terminated by "," enclosed by '\n' LINES TERMINATED BY "\n";

 

相关文章:

  • 2022-03-01
  • 2021-12-26
  • 2021-08-24
  • 2021-11-19
  • 2022-01-03
  • 2021-11-08
猜你喜欢
  • 2021-06-10
  • 2021-05-18
  • 2021-10-10
  • 2022-12-23
  • 2021-04-11
  • 2021-09-20
  • 2021-05-19
相关资源
相似解决方案