MySQL big data warehouse receiving (single table)

Source: Internet
Author: User
Tags mysql connection string

MySQL big data warehouse receiving (single table) has been studying data warehouse receiving recently. For the INSERT command, a small amount of data can be satisfied, while for a large amount of data to be inserted into the same table, the speed is very slow, obviously does not meet the requirements. So I found it from the Internet. MYSQL has a LOAD DATA INFILE command. Here is a brief description of the role of load data infile: It mainly records the files into tables in batches, the speed is very fast. However, operations can only be performed on one table. That is to say, all records are in one table, which has certain limitations. MYSQL connection string:

                 m_pConnection->Open("DRIVER={MySQL ODBC 5.1 Driver}; SERVER=localhost; DATABASE=test;","root","123456",adModeUnknown);

 

{MySQL ODBC 5.1 Driver} is the ODBC Driver of MySql. It is downloaded from the official website. Version 5.1 is the IP address of the computer installed in mysql. If it is local, use localhost. DATABASE is the DATABASE to be connected. In the Open method, "root" indicates the database username "123456" indicates the user password. Test procedure: 1. Create a database test 2. Execute the following database script in this database
                              CREATE TABLE T_TEST(                                                      F_ID BIGINT PRIMARY KEY,                                                      F_NAME VARCHAR(32),                                                      F_SEX SMALLINT,                                                      F_BIRTHDAY DATETIME,                                                      F_CONTENT VARCHAR(512));

 

3. Make sure that the T_TEST table is empty when executing the program. 4. The test result is that 10 million pieces of data can be stored in the database around 1 s.

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.