Home > Database > Mysql Tutorial > body text

Efficient MySQL batch insert BULK INSERT

大家讲道理
Release: 2016-11-10 11:17:53
Original
1680 people have browsed it

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');
Copy after login

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

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template