Mysql导出数据表到文件
/** 导出数据库的方法: (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";
本文原创作者:古道瘦西风,转载请注明原文链接:https://www.cnblogs.com/kingkangstudy/articles/6146379.html