1. 导出
select * from test_info   
into outfile '/tmp/test.csv'   
fields terminated by ',' optionally enclosed by '"' escaped by '"'   
lines terminated by '\r\n';  
  1. 导入
load data infile '/tmp/test.csv'   
into table test_info    
fields terminated by ','  optionally enclosed by '"' escaped by '"'   
lines terminated by '\r\n';  

如果是远程连接mysql,可能会报错,可以试试 load data local infile …..

如果使用工具的话,一般更简单,比如使用navicat , workbench等

workbench可参考官方文档:
https://dev.mysql.com/doc/workbench/en/wb-admin-export-import-table.html

http://www.jianshu.com/p/d330edb61fe2
http://blog.csdn.net/sara_yhl/article/details/6850107

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐