7月 042016
 

场景:

mysql导出导入大数据文件时,如果文件很大,导入时最好先把索引都去掉,如果导出时包含表结构,则在一个很大的文件上编辑表结构将非常麻烦,所以正确的做法:

1. 导出表结构(不包含数据)

2. 编辑表结构(去掉索引)

3. 创建表

4. 导出表数据 (不包含表结构)

5. 导入数据

6. 添加索引

 

附:

解压大文件直接到mysql:

如何知道灌到什么程度了?

tar 在解压的时候,使用的也是外部的解压程序(如:gzip),通过管道交互,可以查看gzip读的那个文件读到哪里了,如:

 

 Posted by at 下午 6:56

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

(required)

(required)

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据