Home > Database > Mysql Tutorial > 如何更快速的把数据插入Mysql

如何更快速的把数据插入Mysql

WBOY
Release: 2016-06-07 14:57:17
Original
1155 people have browsed it

1.拼SQL语句,insert后面带1000个value一次性提交; 2.使用连接池,保持长连接插入; 3.更换Mysql的存储引擎为Inforbright,然后把数据做成文本,批量导入 4.使用队列,保持最高插入速度 有没人有其他更好的方法,最近有130G每天都文件要入库分析,期待指引密

1.拼SQL语句,insert后面带1000个value一次性提交;
2.使用连接池,保持长连接插入;
3.更换Mysql的存储引擎为Inforbright,然后把数据做成文本,批量导入
4.使用队列,保持最高插入速度

有没人有其他更好的方法,最近有130G每天都文件要入库分析,期待指引密经。

源码与演示:源码出处 演示出处

LOAD DATA INFILE 'F:\am_mp3\\data.txt' IGNORE INTO TABLE music.album CHARACTER SET utf8  FIELDS TERMINATED BY ',' lines terminated by '\r\n' (album_id,album_name,singer_name,publish_time,song_count);
Copy after login
Related labels:
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