CREATE TABLE `100000_insert` ( `id` int(11) NOT NULL AUTO_INCREMENT, `parentid` int(11) NOT NULL, `name` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8
100000 (10万)行插入:Insert 100000_line_data use 2.5534288883209 seconds
1000000(100万)行插入:Insert 1000000_line_data use 19.677318811417 seconds
//可能报错:MySQL server has gone away
//解决:修改my.ini/my.cnf max_allowed_packet=20M
您可能感兴趣的文章: