Home >Database >Mysql Tutorial >Efficient MySQL batch insert BULK INSERT

Efficient MySQL batch insert BULK INSERT

大家讲道理
大家讲道理Original
2016-11-10 11:17:531735browse

MySQL’s batch insert BULK INSERT is about the same speed as load data and is reliable.

The syntax is as follows

Suppose there is a table test (ID NUMBER, NAME VARCHAR(10))

insert into test values(1,'aa'),(2,'bb'),.....(100000,'bb');

That is, each record is separated by a comma and ends with a semicolon. It only takes less than 10 to insert 100,000 records. Seconds

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn