{"id":698,"date":"2024-03-15T08:46:03","date_gmt":"2024-03-15T08:46:03","guid":{"rendered":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/?p=698"},"modified":"2025-05-06T14:15:16","modified_gmt":"2025-05-06T14:15:16","slug":"how-to-import-large-sql-file-in-phpmyadmin-html","status":"publish","type":"post","link":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/305\/How-to-Import-Large-SQL-File-In-phpmyadmin.html","title":{"rendered":"How to Import Large SQL file in phpMyAdmin?"},"content":{"rendered":"<hr>\n\n<h2 class=\"wp-block-heading\"><strong>Highlights<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>If you face issues like file size limits, timeout errors, or memory exhaustion while importing large files to phpmyadmin, you can try these solutions: Compress SQL File, Increase Your Server\u2019s PHP File Size Limit, Use MySQL Command in Terminal.<\/li>\n\n<br>\n\n<li>Below, you will find the detailed steps to successfully import your large SQL file.<\/li>\n<\/ul>\n\n<hr>\n<div class=\"kb-article-content\">\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif;\">When importing large SQL files into phpMyAdmin, you can often result in timeouts or server errors.\u00a0<\/span><\/p>\n<p><span style=\"font-family: verdana, geneva, sans-serif;\"><strong>Don\u2019t worry!<\/strong><\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif;\">With the right approach and some optimizations, it is possible to import large SQL files into phpMyAdmin successfully.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif;\">In this article, we will discuss the solutions with which you can easily import large SQL files in phpMyadmin.<\/span><\/p>\n<hr style=\"border-top: 2px dotted black;\" \/>\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif;\"><strong>Also Read: <\/strong><a href=\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/257\/how-to-fix-the-504-bad-gateway-timeout-error.html\"><strong>How to Fix the 504 Bad Gateway Timeout Error?<\/strong><\/a><\/span><\/p>\n<hr style=\"border-top: 2px dotted black;\" \/>\n<h2><span style=\"font-family: verdana, geneva, sans-serif;\"><strong>Solutions to Import Large SQL file in phpMyAdmin<\/strong><\/span><\/h2>\n<h3><span style=\"font-family: verdana, geneva, sans-serif;\"><strong>\u27a2 Solution-1: Compress SQL File<\/strong><\/span><\/h3>\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif;\">If you have SQL files that are not much larger in size, you can use this solution to import the file in phpMyAdmin quickly.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif;\">You just need to compress the .sql file using gzip or zip. You can also use any other compression method as well. With the help of this, you can achieve a major size reduction.<\/span><\/p>\n<hr style=\"border-top: 2px dotted black;\" \/>\n<p><span style=\"font-family: verdana, geneva, sans-serif;\"><strong>Also Read: <\/strong><a href=\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/299\/How-to-Download-SQL-Database-in-cPanel.html\"><strong>How to Download SQL Database From cPanel?<\/strong><\/a><\/span><\/p>\n<hr style=\"border-top: 2px dotted black;\" \/>\n<h3><span style=\"font-family: verdana, geneva, sans-serif;\"><strong>\u27a2 <\/strong><strong>Solution-2: Increase Your Server\u2019s PHP File Size Limit<\/strong><\/span><\/h3>\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif;\">If the solution mentioned above doesn\u2019t work for you. Increasing your server\u2019s PHP file size limit is another good solution that you can apply to solve this problem.<\/span><\/p>\n<p><span style=\"font-family: verdana, geneva, sans-serif;\"><strong>To do this, you simply need to follow the following:<\/strong><\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif;\">\u2794 You have to Open the \u2018php.ini\u2019 file on your server.<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif;\">\u2794 In that, you just need to update the given lines below.<\/span><\/p>\n<table style=\"border-collapse: collapse; width: 100%; margin: 20px 0px;\" border=\"1\">\n<tbody>\n<tr>\n<td style=\"padding: 10px 10px; width: 99.938%;\">\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif;\">max_execution_time = 1024\u00a0 \u00a0 \/\/ 30 minutes\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif;\">max_input_time = 1024\u00a0 \u00a0 \u00a0 \u00a0 \/\/ 30 minutes\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif;\">memory_limit = 2048M \u00a0 \u00a0 \u00a0 \u00a0 \/\/ 2 GB<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif;\">upload_max_filesize = 2048M\u00a0 \/\/ 2 GB\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif;\">post_max_size = 2048M\u00a0 \u00a0 \u00a0 \u00a0 \/\/ 2 GB<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif;\">\u2794 Once you update it, just save the file.<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif;\">After that, restart your web server to apply the changes.<\/span><\/p>\n<hr style=\"border-top: 2px dotted black;\" \/>\n<p><span style=\"font-family: verdana, geneva, sans-serif;\"><strong>Also Read: <\/strong><a href=\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/277\/how-to-increase-max-upload-size-in-cpanel.html\"><strong>How to Increase Max Upload Size in cPanel?<\/strong><\/a><\/span><\/p>\n<hr style=\"border-top: 2px dotted black;\" \/>\n<h3><span style=\"font-family: verdana, geneva, sans-serif;\"><strong>\u27a2 <\/strong><strong>Solution-3: Use MySQL Command in Terminal<\/strong><\/span><\/h3>\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif;\">Another solution for solving this problem is to consider using the command line in your terminal to import the SQL file.<\/span><\/p>\n<p><span style=\"font-family: verdana, geneva, sans-serif;\"><strong>To do this, you simply need to follow the following:<\/strong><\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif;\">\u2794 First, open a terminal and use the following command below when your database file is in any other directory.<\/span><\/p>\n<table style=\"border-collapse: collapse; width: 100%; margin: 20px 0px;\" border=\"1\">\n<tbody>\n<tr>\n<td style=\"padding: 10px 10px; width: 100%;\"><span style=\"font-family: 'Console', monospace;\"><strong>mysql -u username -p new_database &lt; \/path\/old_database.sql <\/strong><\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif;\">\u2794 Use the command below if your database file is in the public_html directory.<\/span><\/p>\n<table style=\"border-collapse: collapse; width: 100%; margin: 20px 0px;\" border=\"1\">\n<tbody>\n<tr>\n<td style=\"padding: 10px 10px; width: 100%;\"><span style=\"font-family: 'Console', monospace;\"><strong>mysql -u username -p new_database &lt; old_database.sql<\/strong><\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-family: verdana, geneva, sans-serif;\"><strong>In this case:\u00a0<\/strong><\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif;\">\u2605 username: Your username of MYSQL.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif;\">\u2605 new_database &#8211; A file name in which you want to import your old database file.<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif;\">\u2605 \/path\/old_database.sql &#8211; Full path to your .sql file or\u00a0 old_database.sql file name\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif;\">When prompted, provide your MySQL credentials and complete the import process.<\/span><\/p>\n<h2><span style=\"font-family: verdana, geneva, sans-serif;\"><strong>Conclusion<\/strong><\/span><\/h2>\n<p><span style=\"font-weight: 400; font-family: verdana, geneva, sans-serif;\">All of these provided solutions are the best for resolving the issue. We hope that they will be helpful for you in mitigating the problem.<\/span><\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>Highlights When importing large SQL files into phpMyAdmin, you can often result in timeouts or server errors.\u00a0 Don\u2019t worry! With the right approach and some optimizations, it is possible to import large SQL files into phpMyAdmin successfully.\u00a0 In this article, we will discuss the solutions with which you can easily import large SQL files in [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[57],"tags":[],"class_list":["post-698","post","type-post","status-publish","format-standard","hentry","category-mysql"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Import Large SQL file in phpMyAdmin?<\/title>\n<meta name=\"description\" content=\"Get a solution for importing large SQL files in phpMyAdmin and optimize your database management for seamless performance. Let\u2019s get started!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/305\/How-to-Import-Large-SQL-File-In-phpmyadmin.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Import Large SQL file in phpMyAdmin?\" \/>\n<meta property=\"og:description\" content=\"Get a solution for importing large SQL files in phpMyAdmin and optimize your database management for seamless performance. Let\u2019s get started!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/305\/How-to-Import-Large-SQL-File-In-phpmyadmin.html\" \/>\n<meta property=\"og:site_name\" content=\"Host IT Smart Knowledge base\" \/>\n<meta property=\"article:published_time\" content=\"2024-03-15T08:46:03+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-05-06T14:15:16+00:00\" \/>\n<meta name=\"author\" content=\"Admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/305\/How-to-Import-Large-SQL-File-In-phpmyadmin.html\",\"url\":\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/305\/How-to-Import-Large-SQL-File-In-phpmyadmin.html\",\"name\":\"How to Import Large SQL file in phpMyAdmin?\",\"isPartOf\":{\"@id\":\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/#website\"},\"datePublished\":\"2024-03-15T08:46:03+00:00\",\"dateModified\":\"2025-05-06T14:15:16+00:00\",\"author\":{\"@id\":\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/#\/schema\/person\/317c14a877385667f19d3b7496bd5108\"},\"description\":\"Get a solution for importing large SQL files in phpMyAdmin and optimize your database management for seamless performance. Let\u2019s get started!\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/305\/How-to-Import-Large-SQL-File-In-phpmyadmin.html\"]}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/#website\",\"url\":\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/\",\"name\":\"Host IT Smart Knowledge base\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/#\/schema\/person\/317c14a877385667f19d3b7496bd5108\",\"name\":\"Admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d4827c56a6721070dde339640d47ff44ba0d0e515c7e577cf29305ab72383fe3?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d4827c56a6721070dde339640d47ff44ba0d0e515c7e577cf29305ab72383fe3?s=96&d=mm&r=g\",\"caption\":\"Admin\"},\"sameAs\":[\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/\"],\"url\":\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Import Large SQL file in phpMyAdmin?","description":"Get a solution for importing large SQL files in phpMyAdmin and optimize your database management for seamless performance. Let\u2019s get started!","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:\/\/www.hostitsmart.com\/manage\/knowledgebase\/305\/How-to-Import-Large-SQL-File-In-phpmyadmin.html","og_locale":"en_US","og_type":"article","og_title":"How to Import Large SQL file in phpMyAdmin?","og_description":"Get a solution for importing large SQL files in phpMyAdmin and optimize your database management for seamless performance. Let\u2019s get started!","og_url":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/305\/How-to-Import-Large-SQL-File-In-phpmyadmin.html","og_site_name":"Host IT Smart Knowledge base","article_published_time":"2024-03-15T08:46:03+00:00","article_modified_time":"2025-05-06T14:15:16+00:00","author":"Admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Admin","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/305\/How-to-Import-Large-SQL-File-In-phpmyadmin.html","url":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/305\/How-to-Import-Large-SQL-File-In-phpmyadmin.html","name":"How to Import Large SQL file in phpMyAdmin?","isPartOf":{"@id":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/#website"},"datePublished":"2024-03-15T08:46:03+00:00","dateModified":"2025-05-06T14:15:16+00:00","author":{"@id":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/#\/schema\/person\/317c14a877385667f19d3b7496bd5108"},"description":"Get a solution for importing large SQL files in phpMyAdmin and optimize your database management for seamless performance. Let\u2019s get started!","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/305\/How-to-Import-Large-SQL-File-In-phpmyadmin.html"]}]},{"@type":"WebSite","@id":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/#website","url":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/","name":"Host IT Smart Knowledge base","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/#\/schema\/person\/317c14a877385667f19d3b7496bd5108","name":"Admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d4827c56a6721070dde339640d47ff44ba0d0e515c7e577cf29305ab72383fe3?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d4827c56a6721070dde339640d47ff44ba0d0e515c7e577cf29305ab72383fe3?s=96&d=mm&r=g","caption":"Admin"},"sameAs":["https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/"],"url":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/posts\/698","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/comments?post=698"}],"version-history":[{"count":6,"href":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/posts\/698\/revisions"}],"predecessor-version":[{"id":2975,"href":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/posts\/698\/revisions\/2975"}],"wp:attachment":[{"href":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/media?parent=698"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/categories?post=698"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/tags?post=698"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}