MySQL InnoDB Fast Import data

Source: Internet
Author: User

Import the data that needs to be analyzed into the database today.

Data of nearly 70 million, stored in TXT file, a total of 5.75G. It was imported using load data infile and took 18 hours to import. The following changes were mainly made:

1. mysql optimization

Key_buffer_size = 64M
Max_allowed_packet = 8M

Innodb_buffer_pool_size = 1024M

Innodb_flush_log_at_trx_commit = 0

Innodb_support_xa = 0

2. mysql Settings

Poke me.

(1)

SET autocommit=0;

   ... SQL import statements

   ...COMMIT;

(2)

SET unique_checks=0;

  ... SQL import statements ...

SET Unique_checks=1;

(3)

SET foreign_key_checks=0;

  ... SQL import statements ...

SET Foreign_key_checks=1;

  

No picture, no truth.

MySQL InnoDB Fast Import data

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.