mysql 导出和导入数据

导出数据

select * from table into outfile ‘/你的文件夹路径/table.txt' where + 条件

导入数据

load data local infile ‘/home/table.txt' into table `table` character set utf8; 
character set utf8 是为了指定utf8编码,有时出现乱码需要加这句话

 若出现 Can't create/write to file 的问题,参考我的另一篇文章 https://www.cnblogs.com/YC-L/p/12624116.html

猜你喜欢

转载自www.cnblogs.com/YC-L/p/12661843.html