{"id":6413,"date":"2025-01-06T05:46:45","date_gmt":"2025-01-06T05:46:45","guid":{"rendered":"https:\/\/ubiq.co\/tech-blog\/?p=6413"},"modified":"2025-01-06T05:57:26","modified_gmt":"2025-01-06T05:57:26","slug":"how-to-import-sql-file-in-mysql","status":"publish","type":"post","link":"https:\/\/ubiq.co\/tech-blog\/how-to-import-sql-file-in-mysql\/","title":{"rendered":"How to Import SQL File in MySQL"},"content":{"rendered":"\n<p>Often database programmers and administrators need to create databases from files. Sometimes, they may need to import data from a file into databases. For these purposes, you need to import SQL file in MySQL. There are several ways to do this. In this article, we will learn how to import SQL file 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-import-sql-file-in-mysql\/#How_to_Import_SQL_File_in_MySQL\" >How to Import SQL File 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-import-sql-file-in-mysql\/#1_Using_Command_Line_Interface_CLI\" >1. Using Command Line Interface (CLI)<\/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-import-sql-file-in-mysql\/#2_Using_Source_Command\" >2. Using Source Command<\/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-import-sql-file-in-mysql\/#3_Using_Load_Data\" >3. Using Load Data<\/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-import-sql-file-in-mysql\/#4_Using_PHPMyAdmin\" >4. Using PHPMyAdmin<\/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-import-sql-file-in-mysql\/#5_Using_MySQL_Workbench\" >5. Using MySQL Workbench<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-import-sql-file-in-mysql\/#Common_Errors\" >Common Errors<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-import-sql-file-in-mysql\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_Import_SQL_File_in_MySQL\"><\/span>How to Import SQL File in MySQL<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Here are the different ways to import SQL file in MySQL. First of all, create an empty database where you can import data. Log into MySQL.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ mysql -u &lt;username> -p &lt;password><\/pre>\n\n\n\n<p>Run the following command to create an empty database testdb.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql> create database testdb;<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_Using_Command_Line_Interface_CLI\"><\/span>1. Using Command Line Interface (CLI)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The MySQL command used to log into your MySQL database, can also be used to import file into a database. You need to run the command from terminal (Mac\/Linux) or command prompt, without logging into MySQL console. Here is its syntax.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ mysql -u &lt;username> -p &lt;password> &lt;database_name> &lt; \/path\/to\/sql\/file<\/pre>\n\n\n\n<p>In the above command, we need to mention MySQL username and password, along with the database name. Lastly, we need to mention the path to SQL file. Here is a sample command to import file testdb.sql.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ mysql -u test_user -p test_password testdb &lt; \/home\/ubuntu\/test.sql<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_Using_Source_Command\"><\/span>2. Using Source Command<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Source command allows you to import SQL file to database from within MySQL console. Here is its syntax.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql> source \/path\/to\/file<\/pre>\n\n\n\n<p>Before we run the above command, we need to switch our target database.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql> use testdb;<\/pre>\n\n\n\n<p>Then we run the source command.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql> source \/home\/ubuntu\/data.sql<\/pre>\n\n\n\n<p>If the above command runs successfully, it will display how many queries were successfully executed.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_Using_Load_Data\"><\/span>3. Using Load Data<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>LOAD DATA is another MySQL command that can be run from within MySQL console. It is used to import a csv or tab delimited file into MySQL table, instead of database. Here is its syntax.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql> LOAD DATA INFILE \/path\/to\/file<br> INTO TABLE &lt;table_name><br> FIELDS TERMINATED BY ','<br> ENCLOSED BY '\"'<br> LINES TERMINATED BY '\\n'<br> IGNORE 1 ROWS;<\/pre>\n\n\n\n<p>In the above command we mention the path to CSV file after LOAD DATA INFILE. We also specify the table name. We further mention the delimiter after &#8216;FIELDS TERMINATED BY&#8217;. If our data is enclosed in quotes, then you can mention the enclosing character. This is useful if your file has multi word data items enclosed in quotes. Lastly, we mention the character that is used as newline character. If the first row of our data consists of column headers and you want to ignore them, then you can mention &#8216;IGNORE 1 ROWS&#8217;.<\/p>\n\n\n\n<p>You can also use it to import data from any file where data is separated using delimiters by simply changing the delimiter in above command. This is a great way to import many different kinds of files, whether they are delimited by pipe, tab, comma or some other character. Also it allows you to import data into individual tables, instead of importing the entire database. So it gives more control.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"4_Using_PHPMyAdmin\"><\/span>4. Using PHPMyAdmin<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>PHPMyAdmin is a free, open-source, popular database management tool for MySQL databases. It is used by millions of website owners and system administrators. If you are using PHPMyAdmin to manage your MySQL database, then here are the steps to import database from file.<\/p>\n\n\n\n<p>Open PHPMyAdmin. On left pane, you will see the list of all databases currently present in your MySQL installation. Click the testdb database in that list. Alternatively, click Databases on right pane, you will see a list of databases in your system.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"730\" height=\"167\" src=\"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/01\/Database.png?resize=730%2C167&#038;ssl=1\" alt=\"\" class=\"wp-image-6424\" srcset=\"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/01\/Database.png?w=851&amp;ssl=1 851w, https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/01\/Database.png?resize=768%2C176&amp;ssl=1 768w\" sizes=\"auto, (max-width: 730px) 100vw, 730px\" \/><\/figure>\n<\/div>\n\n\n<p>Click testdb database in the list that is displayed.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"730\" height=\"204\" src=\"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/01\/Select-database-1.png?resize=730%2C204&#038;ssl=1\" alt=\"\" class=\"wp-image-6427\" srcset=\"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/01\/Select-database-1.png?w=849&amp;ssl=1 849w, https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/01\/Select-database-1.png?resize=768%2C214&amp;ssl=1 768w\" sizes=\"auto, (max-width: 730px) 100vw, 730px\" \/><\/figure>\n\n\n\n<p>Next, click on Import tab, on the right pane.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"730\" height=\"140\" src=\"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/01\/Database-Import.png?resize=730%2C140&#038;ssl=1\" alt=\"\" class=\"wp-image-6425\" srcset=\"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/01\/Database-Import.png?w=849&amp;ssl=1 849w, https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/01\/Database-Import.png?resize=768%2C147&amp;ssl=1 768w\" sizes=\"auto, (max-width: 730px) 100vw, 730px\" \/><\/figure>\n<\/div>\n\n\n<p>Click Choose File and you will see a file browser window open. Browse to .sql or .sql.zip file and click Go.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"730\" height=\"489\" src=\"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/01\/Choose-file.png?resize=730%2C489&#038;ssl=1\" alt=\"\" class=\"wp-image-6428\" srcset=\"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/01\/Choose-file.png?w=849&amp;ssl=1 849w, https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/01\/Choose-file.png?resize=768%2C515&amp;ssl=1 768w\" sizes=\"auto, (max-width: 730px) 100vw, 730px\" \/><\/figure>\n<\/div>\n\n\n<p>PHPMyAdmin will start importing the database. After the import is complete, it will show a success message on right pane, and a list of all database tables in left pane.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"5_Using_MySQL_Workbench\"><\/span>5. Using MySQL Workbench<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>MySQL Workbench is a free, graphical tool to manage MySQL databases. It is very popular and used by many organizations. While there may be slight variation across different versions, here are the basic steps to import SQL file in Workbench.<\/p>\n\n\n\n<p>Under &#8216;<strong>Server Administration<\/strong>&#8216; or &#8216;<strong>Management<\/strong>&#8216; on Home Window, click &#8216;New Server Instance&#8217; to create a new empty database. If it already exists, then click the server instance&#8217;s name. <\/p>\n\n\n\n<p>Click <strong>Manage Import\/Export<\/strong>.<\/p>\n\n\n\n<p>Click <strong>Data Import\/Restore<\/strong> on the left pane of the screen.<\/p>\n\n\n\n<p>On right pane of screen, you will see a radio button &#8216;<strong>Import from Self-Contained File<\/strong>&#8216;. Select path of .sql file.<\/p>\n\n\n\n<p>Lastly, click <strong>Start Import<\/strong> button at the bottom right corner of window.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"730\" height=\"340\" src=\"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/01\/mysql-workbench-import.jpg?resize=730%2C340&#038;ssl=1\" alt=\"\" class=\"wp-image-6449\" srcset=\"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/01\/mysql-workbench-import.jpg?w=776&amp;ssl=1 776w, https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/01\/mysql-workbench-import.jpg?resize=768%2C357&amp;ssl=1 768w\" sizes=\"auto, (max-width: 730px) 100vw, 730px\" \/><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Common_Errors\"><\/span>Common Errors<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>There are several common problems we face while trying to import SQL file into database.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Access denied<\/strong> &#8211; Often users get access denied error while trying to import file in MySQL database. This happens if the MySQL user does not have access to database. So ensure that the MySQL user you use for this purpose has appropriate permissions to access the empty database.<\/li>\n\n\n\n<li><strong>Unknown database<\/strong> &#8211; You get this error if you are using command line interface and have accidentally typed the wrong database name. This can also happen if the database that you are trying to import the file to, does not exist. So make sure to create the empty database before you import SQL file, as well as check if you have used the right database name in your MySQL command.<\/li>\n\n\n\n<li><strong>Syntax Error<\/strong> &#8211; This happens if you have made some syntax error, especially in command line arguments and options. Make sure you are using the correct syntax for your data import commands.<\/li>\n\n\n\n<li><strong>Table exists<\/strong> &#8211; This error is rare but occurs if, while importing SQL file, MySQL tries to create a table that already exists. In this case, you can either drop the table before importing SQL file, or modify the SQL file to exclude the table.<\/li>\n<\/ol>\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 how to import SQL file into MySQL. Some of them are useful importing entire database, while some are useful for importing individual tables. Depending on your requirement, you can use any of these methods.<\/p>\n\n\n\n<p>Also read:<\/p>\n\n\n\n<p><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-concatenate-multiple-mysql-rows-into-one-field\/\">How to Concatenate Multiple MySQL Rows Into Column<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-reset-auto-increment-in-mysql\/\">How to Reset Auto Increment in MySQL<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-get-character-set-of-mysql-database-or-table-or-column\/\">How to Get Character Set of MySQL Database Column<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes database administrators need to import sql file in MySQL. Here are the different ways to do it.<\/p>\n","protected":false},"author":1,"featured_media":6451,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[324],"tags":[370],"class_list":["post-6413","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mysql","tag-import-sql-file"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Import SQL File in MySQL - Ubiq BI<\/title>\n<meta name=\"description\" content=\"Sometimes database administrators need to import sql file in MySQL. Here are the different ways to do it.\" \/>\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-import-sql-file-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 Import SQL File in MySQL - Ubiq BI\" \/>\n<meta property=\"og:description\" content=\"Sometimes database administrators need to import sql file in MySQL. Here are the different ways to do it.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ubiq.co\/tech-blog\/how-to-import-sql-file-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=\"2025-01-06T05:46:45+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-01-06T05:57:26+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/01\/import-sql-file-database.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"301\" \/>\n\t<meta property=\"og:image:height\" content=\"200\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\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=\"6 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-import-sql-file-in-mysql\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-import-sql-file-in-mysql\\\/\"},\"author\":{\"name\":\"Sreeram Sreenivasan\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"headline\":\"How to Import SQL File in MySQL\",\"datePublished\":\"2025-01-06T05:46:45+00:00\",\"dateModified\":\"2025-01-06T05:57:26+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-import-sql-file-in-mysql\\\/\"},\"wordCount\":997,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-import-sql-file-in-mysql\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2025\\\/01\\\/import-sql-file-database.jpg?fit=301%2C200&ssl=1\",\"keywords\":[\"import sql file\"],\"articleSection\":[\"MySQL\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-import-sql-file-in-mysql\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-import-sql-file-in-mysql\\\/\",\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-import-sql-file-in-mysql\\\/\",\"name\":\"How to Import SQL File in MySQL - Ubiq BI\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-import-sql-file-in-mysql\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-import-sql-file-in-mysql\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2025\\\/01\\\/import-sql-file-database.jpg?fit=301%2C200&ssl=1\",\"datePublished\":\"2025-01-06T05:46:45+00:00\",\"dateModified\":\"2025-01-06T05:57:26+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"description\":\"Sometimes database administrators need to import sql file in MySQL. Here are the different ways to do it.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-import-sql-file-in-mysql\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-import-sql-file-in-mysql\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-import-sql-file-in-mysql\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2025\\\/01\\\/import-sql-file-database.jpg?fit=301%2C200&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2025\\\/01\\\/import-sql-file-database.jpg?fit=301%2C200&ssl=1\",\"width\":301,\"height\":200,\"caption\":\"import sql file into mysql database\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-import-sql-file-in-mysql\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Import SQL File 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 Import SQL File in MySQL - Ubiq BI","description":"Sometimes database administrators need to import sql file in MySQL. Here are the different ways to do it.","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-import-sql-file-in-mysql\/","og_locale":"en_US","og_type":"article","og_title":"How to Import SQL File in MySQL - Ubiq BI","og_description":"Sometimes database administrators need to import sql file in MySQL. Here are the different ways to do it.","og_url":"https:\/\/ubiq.co\/tech-blog\/how-to-import-sql-file-in-mysql\/","og_site_name":"Ubiq BI","article_publisher":"https:\/\/www.facebook.com\/ubiqbi","article_published_time":"2025-01-06T05:46:45+00:00","article_modified_time":"2025-01-06T05:57:26+00:00","og_image":[{"width":301,"height":200,"url":"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/01\/import-sql-file-database.jpg","type":"image\/jpeg"}],"author":"Sreeram Sreenivasan","twitter_card":"summary_large_image","twitter_creator":"@UbiqBI","twitter_site":"@UbiqBI","twitter_misc":{"Written by":"Sreeram Sreenivasan","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-import-sql-file-in-mysql\/#article","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-import-sql-file-in-mysql\/"},"author":{"name":"Sreeram Sreenivasan","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"headline":"How to Import SQL File in MySQL","datePublished":"2025-01-06T05:46:45+00:00","dateModified":"2025-01-06T05:57:26+00:00","mainEntityOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-import-sql-file-in-mysql\/"},"wordCount":997,"commentCount":0,"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-import-sql-file-in-mysql\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/01\/import-sql-file-database.jpg?fit=301%2C200&ssl=1","keywords":["import sql file"],"articleSection":["MySQL"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ubiq.co\/tech-blog\/how-to-import-sql-file-in-mysql\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-import-sql-file-in-mysql\/","url":"https:\/\/ubiq.co\/tech-blog\/how-to-import-sql-file-in-mysql\/","name":"How to Import SQL File in MySQL - Ubiq BI","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-import-sql-file-in-mysql\/#primaryimage"},"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-import-sql-file-in-mysql\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/01\/import-sql-file-database.jpg?fit=301%2C200&ssl=1","datePublished":"2025-01-06T05:46:45+00:00","dateModified":"2025-01-06T05:57:26+00:00","author":{"@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"description":"Sometimes database administrators need to import sql file in MySQL. Here are the different ways to do it.","breadcrumb":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-import-sql-file-in-mysql\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ubiq.co\/tech-blog\/how-to-import-sql-file-in-mysql\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-import-sql-file-in-mysql\/#primaryimage","url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/01\/import-sql-file-database.jpg?fit=301%2C200&ssl=1","contentUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/01\/import-sql-file-database.jpg?fit=301%2C200&ssl=1","width":301,"height":200,"caption":"import sql file into mysql database"},{"@type":"BreadcrumbList","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-import-sql-file-in-mysql\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ubiq.co\/tech-blog\/"},{"@type":"ListItem","position":2,"name":"How to Import SQL File 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\/01\/import-sql-file-database.jpg?fit=301%2C200&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/pbGGTT-1Fr","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/6413","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=6413"}],"version-history":[{"count":37,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/6413\/revisions"}],"predecessor-version":[{"id":6460,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/6413\/revisions\/6460"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media\/6451"}],"wp:attachment":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media?parent=6413"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/categories?post=6413"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/tags?post=6413"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}