MySQL big data warehouse receiving (single table) _ MySQL

Source: Internet
Author: User
Tags mysql connection string
MySQL big data warehouse receiving (single table) bitsCN.com

MySQL big data warehouse receiving (single table)

Recently, I have been studying data warehouse receiving. 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 and 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 on the official website and version 5.1 is

SERVER is the IP address of the mysql computer, if it is a local 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 during program execution.

4. the test result is that pieces of data can be stored in the database in about 1 s.

BitsCN.com

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.