MySQL – how many rows can I insert in one single INSERT statement?

You can insert infinitely large number of records using INSERT ... SELECT pattern, provided you have those records, or part of, in other tables.

But if you are hard-coding the values using INSERT ... VALUES pattern, then there is a limit on how large/long your statement is: max_allowed_packet which limits the length of SQL statements sent by the client to the database server, and it affects any types of queries and not only for INSERT statement.

Leave a Comment