# How can I speed up data import

**URL:** <https://forum.codewithmosh.com/t/how-can-i-speed-up-data-import/16946>\
**Category:** SQL\
**Created:** [December 9, 2022, 11:00pm UTC](https://forum.codewithmosh.com/t/how-can-i-speed-up-data-import/16946 "2022-12-09T23:00:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nwfoxflyer](https://avatars.discourse-cdn.com/v4/letter/n/a3d4f5/32.png) [@nwfoxflyer](https://forum.codewithmosh.com/u/nwfoxflyer)\
**Post date:** [December 9, 2022, 11:00pm UTC](https://forum.codewithmosh.com/t/how-can-i-speed-up-data-import/16946/1 "2022-12-09T23:00:15Z")

</div>

Hello,

I have been using MySQL Workbench in an attempt to import 5.5 million records from a CSV file into an empty table that has no indexes or foreign keys. When I run the procedure, the data loads, but it takes almost 4 seconds per row to load. The table has 36 columns and is a list of names and addresses, nothing special. I am not worried about data validation; I just need to get it loaded without missing rows and not take two weeks to do it. Any suggestions would be greatly appreciated.

Thank you,  
Gary

---

<div class="post-metadata">

**Author:** ![SAM](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/sam/32/167_2.png) [@SAM](https://forum.codewithmosh.com/u/SAM)\
**Post date:** [December 10, 2022, 10:23am UTC](https://forum.codewithmosh.com/t/how-can-i-speed-up-data-import/16946/2 "2022-12-10T10:23:04Z")

</div>

Sounds like an [autocommit](https://dev.mysql.com/doc/refman/8.0/en/innodb-autocommit-commit-rollback.html) issue. Try to `SET autocommit=0;` before importing the data.

---

<div class="post-metadata">

**Author:** ![jumboworld](https://avatars.discourse-cdn.com/v4/letter/j/eada6e/32.png) [@jumboworld](https://forum.codewithmosh.com/u/jumboworld)\
**Post date:** [October 15, 2023, 11:23pm UTC](https://forum.codewithmosh.com/t/how-can-i-speed-up-data-import/16946/3 "2023-10-15T23:23:02Z")

</div>

@SAM how do you? Please where can he set the autocommit for the system to recognize the command?

---

<div class="post-metadata">

**Author:** ![SAM](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/sam/32/167_2.png) [@SAM](https://forum.codewithmosh.com/u/SAM)\
**Post date:** [October 16, 2023, 4:40am UTC](https://forum.codewithmosh.com/t/how-can-i-speed-up-data-import/16946/4 "2023-10-16T04:40:15Z")

</div>

Just use it like you use other SQL commands.
