MySQL中批量写入数据的方式有以下几种:
INSERT INTO table_name (column1, column2, column3) VALUES
(value1, value2, value3),
(value4, value5, value6),
(value7, value8, value9);
INSERT INTO table_name (column1, column2, column3)
SELECT column1, column2, column3
FROM source_table
WHERE condition;
LOAD DATA INFILE ‘file_name.txt’
INTO TABLE table_name
FIELDS TERMINATED BY ‘,’
LINES TERMINATED BY ‘\n’;
INSERT INTO table_name (column1, column2, column3)
VALUES (value1, value2, value3),
(value4, value5, value6),
…
(valueN, valueN+1, valueN+2);
以上是MySQL中批量写入数据的常用方式,根据具体需求可以选择适合的方式进行批量写入。