{"id":8497,"date":"2020-11-27T07:48:00","date_gmt":"2020-11-27T07:48:00","guid":{"rendered":"https:\/\/ubiq.co\/tech-blog\/?p=8497"},"modified":"2025-08-28T05:54:34","modified_gmt":"2025-08-28T05:54:34","slug":"how-to-insert-multiple-rows-in-mysql","status":"publish","type":"post","link":"https:\/\/ubiq.co\/tech-blog\/how-to-insert-multiple-rows-in-mysql\/","title":{"rendered":"How to Insert Multiple Rows in MySQL"},"content":{"rendered":"\n<p>MySQL database allows you to easily insert, modify and delete rows of data from database tables. Sometimes you may need to insert multiple rows of data in MySQL. Generally, database developers run separate INSERT statements for each new row to be added. But MySQL allows you to enter single as well as multiple rows of information with a single query. This is more efficient since it reduces the number of queries processed by your database. In this article, we will look at how to insert multiple rows in MySQL.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-insert-multiple-rows-in-mysql\/#How_to_Insert_Multiple_Rows_in_MySQL\" >How to Insert Multiple Rows in MySQL<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-insert-multiple-rows-in-mysql\/#1_Insert_multiple_rows_using_INSERT\" >1. Insert multiple rows using INSERT<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-insert-multiple-rows-in-mysql\/#2_Insert_Multiple_Rows_from_SELECT\" >2. Insert Multiple Rows from SELECT<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-insert-multiple-rows-in-mysql\/#3_Insert_Multiple_Rows_Without_Duplicate\" >3. Insert Multiple Rows Without Duplicate<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-insert-multiple-rows-in-mysql\/#4_Using_LOAD_DATA_INFILE\" >4. Using LOAD DATA INFILE<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-insert-multiple-rows-in-mysql\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_Insert_Multiple_Rows_in_MySQL\"><\/span>How to Insert Multiple Rows in MySQL<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Here are the steps to insert multiple rows in MySQL. There are multiple ways to insert multiple rows in MySQL. We will look at each of these approaches one by one. Let us say you have the following MySQL table <em>employees(id, first_name, last_name)<\/em>.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql&gt; create table employees(id int,<br>       first_name varchar(255),<br>       last_name varchar(255));<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_Insert_multiple_rows_using_INSERT\"><\/span>1. Insert multiple rows using INSERT<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Generally, INSERT statement is used to insert a single row of data. In case you need to enter multiple rows, people run different INSERT statements, one for each row. But it is possible to insert multiple database rows using a single INSERT statement. Here is the syntax to insert multiple rows using INSERT statement.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">INSERT INTO table_name(column1, column2, ...),\n    values(row1_value1, row1_value2,...),\n          (row2_value1, row2_value2,...),\n          ...<\/pre>\n\n\n\n<p>In the above query, you need to mention your table name into which you need to insert values. Next, you need to enter values of each row enclosed in round brackets &#8216;()&#8217; in a comma-separated manner.<\/p>\n\n\n\n<p>Here is the SQL query to insert multiple rows of information in <em>employees<\/em> table.<\/p>\n\n\n\n<pre id=\"block-64f8e786-4a79-40cb-994d-a555275f9f7b\" class=\"wp-block-preformatted\">mysql&gt; insert into employees(id, first_name, last_name)<br>       values(1,'John','Doe'),<br>       (2,'Jane','Doe');<br><br>mysql&gt; select * from employees;<br>+------+------------+-----------+<br>| id   | first_name | last_name |<br>+------+------------+-----------+<br>|    1 | John       | Doe       |<br>|    2 | Jane       | Doe       |<br>+------+------------+-----------+<\/pre>\n\n\n\n<p>This is known as batch insert or bulk insert in MySQL. It allows you to run lesser number of queries and provides better performance.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_Insert_Multiple_Rows_from_SELECT\"><\/span>2. Insert Multiple Rows from SELECT<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>It can be tedious to construct INSERT statement for multiple rows, in INSERT INTO&#8230;VALUES statement. Or sometimes, you may want to copy data from one table to another. In such cases, you can also insert multiple rows of data into your table using the result of a SELECT query.<\/p>\n\n\n\n<p>Here is the SQL query syntax to copy data from one table to another using INSERT INTO statement.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">INSERT INTO table1 (column1, column2, ...)\nselect column1, column2, ...\nfrom table2<\/pre>\n\n\n\n<p>In the above query, we select column1, column2, &#8230; from table2 and insert them into table1. In this case, MySQL will retrieve the result of SELECT query and use it as an input for INSERT statement.<\/p>\n\n\n\n<p>Please note, the columns used in the INSERT INTO statement and SELECT statement must have same name and order. Otherwise, you will get an error.<\/p>\n\n\n\n<p>Here is the SQL query to copy data from <em>employees<\/em> table to <em>employees2<\/em> table.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql&gt; insert into employees2(id, first_name, last_name)\n       select id, first_name, last_name\n       from employees;\n\nmysql&gt; select * from employees2;\n+------+------------+-----------+\n| id   | first_name | last_name |\n+------+------------+-----------+\n|    1 | John       | Doe       |\n|    2 | Jane       | Doe       |\n+------+------------+-----------+<\/pre>\n\n\n\n<p>You can also use this method to copy rows into the same table. This is a great way to easily populate a table with dummy data for testing purposes. Here is the SQL query to copy paste rows from employees table back into it.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql&gt; insert into employees(id, first_name, last_name)<br>       select id, first_name, last_name<br>       from employees;<br><br>mysql&gt; select * from employees2;<br>+------+------------+-----------+<br>| id   | first_name | last_name |<br>+------+------------+-----------+<br>|    1 | John       | Doe       |<br>|    2 | Jane       | Doe       |<br>|    1 | John       | Doe       |<br>|    2 | Jane       | Doe       |<br>+------+------------+-----------+<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_Insert_Multiple_Rows_Without_Duplicate\"><\/span>3. Insert Multiple Rows Without Duplicate<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In the above example, we see that even duplicate rows are inserted into MySQL table. If you want to automatically avoid duplicate records when you insert multiple values in your table, use IGNORE keyword after INSERT in your SQL query.<\/p>\n\n\n\n<p>However, this works only for tables that have a primary key.<\/p>\n\n\n\n<p>Here is an example, <\/p>\n\n\n\n<pre id=\"block-5c270adb-c449-488b-8bc7-7cbe42d5a434\" class=\"wp-block-preformatted\">mysql&gt; create table employees(id int primary key,\n       first_name varchar(255),\n       last_name varchar(255));\n\nmysql&gt; insert ignore into employees(id, first_name, last_name)\n            values(1,'John','Doe'),\n            (1,'John','Doe');\n\nmysql&gt; select * from employees;\n+----+------------+-----------+\n| id | first_name | last_name |\n+----+------------+-----------+\n|  1 | John       | Doe       |\n+----+------------+-----------+<\/pre>\n\n\n\n<p>As you can see, only 1 row was inserted instead of two duplicate rows.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"4_Using_LOAD_DATA_INFILE\"><\/span>4. Using LOAD DATA INFILE<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Sometimes, you may need to insert data from a text or csv file to your table. You can do this using LOAD DATA INFILE query. Here is the SQL query to load a file&#8217;s data into table.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">LOAD DATA INFILE '\/path\/to\/file.txt'<br>INTO TABLE employees<br>FIELDS TERMINATED BY ','<br>LINES TERMINATED BY '\\n'<br>(id, first_name, last_name);<\/pre>\n\n\n\n<p>In the above file, LOAD DATA INFILE is followed by path to text or csv file. We mention the file delimiter using FIELDS TERMINATED BY clause. We also mention line feed character using LINES TERMINATED BY clause.<\/p>\n\n\n\n<p>If you are using CSV file, use &#8216;,&#8217; for FIELDS TERMINATED BY. If it is a tab delimited text file, then use &#8216; &#8216; instead. The file extension does not really matter but you need to mention the full file path along with its extension in the above SQL query.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In this article, we have learnt 4 different ways to insert multiple rows of data in MySQL, at once. We have learnt how to do it by mentioning the row values in INSERT query itself. We have also learnt how to insert the result of SELECT query into a table. Lastly, we learnt how to load contents of file into table, using INSERT query. You can use any of these methods, depending on your requirement. But please note, by default, the MySQL server can handle up to 4Mb of data. You can change this using MySQL server settings.<\/p>\n\n\n\n<p><a href=\"https:\/\/ubiq.co\/\">Ubiq<\/a>&nbsp;makes it easy to visualize data, and monitor them in real-time dashboards.&nbsp;<a href=\"https:\/\/ubiq.co\/accounts\/register\">Try Ubiq<\/a>&nbsp;for free.<\/p>\n\n\n\n<p>Also read:<br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-update-a-column-based-on-another-column-in-sql\/\">How to Update Column Based on Another Column in MySQL<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-escape-single-quote-special-characters-in-mysql\/\">How to Escape Single Quote, Special Characters in MySQL<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-store-json-data-in-mysql\/\">How to Store JSON Data in MySQL<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes you may need to insert multiple rows in MySQL. Here is how to insert multiple rows in MySQL.<\/p>\n","protected":false},"author":1,"featured_media":8499,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[324],"tags":[473],"class_list":["post-8497","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mysql","tag-insert-multiple"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Insert Multiple Rows in MySQL - Ubiq BI<\/title>\n<meta name=\"description\" content=\"Sometimes you may need to insert multiple rows in MySQL. Here is how to insert multiple rows in MySQL.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-insert-multiple-rows-in-mysql\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Insert Multiple Rows in MySQL - Ubiq BI\" \/>\n<meta property=\"og:description\" content=\"Sometimes you may need to insert multiple rows in MySQL. Here is how to insert multiple rows in MySQL.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ubiq.co\/tech-blog\/how-to-insert-multiple-rows-in-mysql\/\" \/>\n<meta property=\"og:site_name\" content=\"Ubiq BI\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ubiqbi\" \/>\n<meta property=\"article:published_time\" content=\"2020-11-27T07:48:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-28T05:54:34+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/06\/mysql-insert-multiple-rows.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"730\" \/>\n\t<meta property=\"og:image:height\" content=\"410\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"Sreeram Sreenivasan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@UbiqBI\" \/>\n<meta name=\"twitter:site\" content=\"@UbiqBI\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sreeram Sreenivasan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-insert-multiple-rows-in-mysql\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-insert-multiple-rows-in-mysql\\\/\"},\"author\":{\"name\":\"Sreeram Sreenivasan\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"headline\":\"How to Insert Multiple Rows in MySQL\",\"datePublished\":\"2020-11-27T07:48:00+00:00\",\"dateModified\":\"2025-08-28T05:54:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-insert-multiple-rows-in-mysql\\\/\"},\"wordCount\":822,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-insert-multiple-rows-in-mysql\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/mysql-insert-multiple-rows.webp?fit=730%2C410&ssl=1\",\"keywords\":[\"insert multiple\"],\"articleSection\":[\"MySQL\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-insert-multiple-rows-in-mysql\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-insert-multiple-rows-in-mysql\\\/\",\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-insert-multiple-rows-in-mysql\\\/\",\"name\":\"How to Insert Multiple Rows in MySQL - Ubiq BI\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-insert-multiple-rows-in-mysql\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-insert-multiple-rows-in-mysql\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/mysql-insert-multiple-rows.webp?fit=730%2C410&ssl=1\",\"datePublished\":\"2020-11-27T07:48:00+00:00\",\"dateModified\":\"2025-08-28T05:54:34+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"description\":\"Sometimes you may need to insert multiple rows in MySQL. Here is how to insert multiple rows in MySQL.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-insert-multiple-rows-in-mysql\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-insert-multiple-rows-in-mysql\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-insert-multiple-rows-in-mysql\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/mysql-insert-multiple-rows.webp?fit=730%2C410&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/mysql-insert-multiple-rows.webp?fit=730%2C410&ssl=1\",\"width\":730,\"height\":410,\"caption\":\"insert multiple rows in mysql\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-insert-multiple-rows-in-mysql\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Insert Multiple Rows in MySQL\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#website\",\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/\",\"name\":\"Ubiq BI\",\"description\":\"Build dashboards &amp; reports in minutes\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\",\"name\":\"Sreeram Sreenivasan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"caption\":\"Sreeram Sreenivasan\"},\"description\":\"Sreeram Sreenivasan is the Founder of Ubiq. He has helped many Fortune 500 companies in the areas of BI &amp; software development.\",\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/sreeram-sreenivasan\\\/\"],\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/author\\\/wordpress\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Insert Multiple Rows in MySQL - Ubiq BI","description":"Sometimes you may need to insert multiple rows in MySQL. Here is how to insert multiple rows in MySQL.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ubiq.co\/tech-blog\/how-to-insert-multiple-rows-in-mysql\/","og_locale":"en_US","og_type":"article","og_title":"How to Insert Multiple Rows in MySQL - Ubiq BI","og_description":"Sometimes you may need to insert multiple rows in MySQL. Here is how to insert multiple rows in MySQL.","og_url":"https:\/\/ubiq.co\/tech-blog\/how-to-insert-multiple-rows-in-mysql\/","og_site_name":"Ubiq BI","article_publisher":"https:\/\/www.facebook.com\/ubiqbi","article_published_time":"2020-11-27T07:48:00+00:00","article_modified_time":"2025-08-28T05:54:34+00:00","og_image":[{"width":730,"height":410,"url":"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/06\/mysql-insert-multiple-rows.webp","type":"image\/webp"}],"author":"Sreeram Sreenivasan","twitter_card":"summary_large_image","twitter_creator":"@UbiqBI","twitter_site":"@UbiqBI","twitter_misc":{"Written by":"Sreeram Sreenivasan","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-insert-multiple-rows-in-mysql\/#article","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-insert-multiple-rows-in-mysql\/"},"author":{"name":"Sreeram Sreenivasan","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"headline":"How to Insert Multiple Rows in MySQL","datePublished":"2020-11-27T07:48:00+00:00","dateModified":"2025-08-28T05:54:34+00:00","mainEntityOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-insert-multiple-rows-in-mysql\/"},"wordCount":822,"commentCount":0,"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-insert-multiple-rows-in-mysql\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/06\/mysql-insert-multiple-rows.webp?fit=730%2C410&ssl=1","keywords":["insert multiple"],"articleSection":["MySQL"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ubiq.co\/tech-blog\/how-to-insert-multiple-rows-in-mysql\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-insert-multiple-rows-in-mysql\/","url":"https:\/\/ubiq.co\/tech-blog\/how-to-insert-multiple-rows-in-mysql\/","name":"How to Insert Multiple Rows in MySQL - Ubiq BI","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-insert-multiple-rows-in-mysql\/#primaryimage"},"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-insert-multiple-rows-in-mysql\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/06\/mysql-insert-multiple-rows.webp?fit=730%2C410&ssl=1","datePublished":"2020-11-27T07:48:00+00:00","dateModified":"2025-08-28T05:54:34+00:00","author":{"@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"description":"Sometimes you may need to insert multiple rows in MySQL. Here is how to insert multiple rows in MySQL.","breadcrumb":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-insert-multiple-rows-in-mysql\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ubiq.co\/tech-blog\/how-to-insert-multiple-rows-in-mysql\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-insert-multiple-rows-in-mysql\/#primaryimage","url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/06\/mysql-insert-multiple-rows.webp?fit=730%2C410&ssl=1","contentUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/06\/mysql-insert-multiple-rows.webp?fit=730%2C410&ssl=1","width":730,"height":410,"caption":"insert multiple rows in mysql"},{"@type":"BreadcrumbList","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-insert-multiple-rows-in-mysql\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ubiq.co\/tech-blog\/"},{"@type":"ListItem","position":2,"name":"How to Insert Multiple Rows in MySQL"}]},{"@type":"WebSite","@id":"https:\/\/ubiq.co\/tech-blog\/#website","url":"https:\/\/ubiq.co\/tech-blog\/","name":"Ubiq BI","description":"Build dashboards &amp; reports in minutes","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ubiq.co\/tech-blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc","name":"Sreeram Sreenivasan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","caption":"Sreeram Sreenivasan"},"description":"Sreeram Sreenivasan is the Founder of Ubiq. He has helped many Fortune 500 companies in the areas of BI &amp; software development.","sameAs":["https:\/\/www.linkedin.com\/in\/sreeram-sreenivasan\/"],"url":"https:\/\/ubiq.co\/tech-blog\/author\/wordpress\/"}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/06\/mysql-insert-multiple-rows.webp?fit=730%2C410&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/pbGGTT-2d3","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/8497","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/comments?post=8497"}],"version-history":[{"count":3,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/8497\/revisions"}],"predecessor-version":[{"id":9324,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/8497\/revisions\/9324"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media\/8499"}],"wp:attachment":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media?parent=8497"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/categories?post=8497"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/tags?post=8497"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}