{"id":1170,"date":"2021-04-07T15:42:16","date_gmt":"2021-04-07T12:42:16","guid":{"rendered":"https:\/\/www.scalahosting.com\/kb\/?p=1170"},"modified":"2023-03-02T09:49:48","modified_gmt":"2023-03-02T07:49:48","slug":"how-to-export-mysql-database","status":"publish","type":"post","link":"https:\/\/www.scalahosting.com\/kb\/how-to-export-mysql-database\/","title":{"rendered":"How to export MySQL Database?"},"content":{"rendered":"\n<p><b>Exporting a MySQL <\/b><span style=\"font-weight: 400;\">is vital for easy backup of important files and information within the database. When you export a database, you can import it into another database server to access the queried data.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">E<\/span><b>xporting a MySQL database from your account can be done in two ways:<\/b><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><span style=\"font-weight: 400;\">Via phpMyAdmin Tool<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">Via SSH<\/span><\/li>\n<\/ol>\n\n\n\n<p><span style=\"font-weight: 400;\">In this article, we are going to discuss the step-by-step process of both methods.&nbsp;<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Ready? Let\u2019s get to it!<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><b>Export MySQL Database using phpMyAdmin Tool<\/b><\/h2>\n\n\n\n<p><span style=\"font-weight: 400;\">PhpMyAdmin tool is a MySQL application that helps to carry out several database management activities. <\/span><b>With phpMyAdmin, you can:<\/b><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><span style=\"font-weight: 400;\">Create<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">Drop<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">Delete<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">Import<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">export MySQL database tables.<\/span><\/li>\n<\/ul>\n\n\n\n<p><span style=\"font-weight: 400;\">In this section, we are going to show you how to export databases using the phpMyAdmin tool. You can use this method when dealing with smaller-sized files or files that are less than<\/span><b> 128MB.<\/b><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">To export MySQL Database using phpMyAdmin Tool, follow these steps:<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-weight: 400;\">Login into your cPanel Account<\/span><\/h3>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"347\" height=\"355\" src=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image6-1.png\" alt=\"How to export MySQL Database?, Login into your cPanel Account\" class=\"wp-image-1174\" srcset=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image6-1.png 347w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image6-1-293x300.png 293w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"font-weight: 400;\">Scroll to the Databases section and select the phpMyAdmin tab<\/span><\/h3>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"832\" height=\"140\" src=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image4-3.png\" alt=\"How to export MySQL Database?, Scroll to the Databases section and select the phpMyAdmin tab\" class=\"wp-image-1172\" srcset=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image4-3.png 832w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image4-3-300x50.png 300w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image4-3-768x129.png 768w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/figure>\n\n\n\n<p><span style=\"font-weight: 400;\">In the phpMyAdmin area, the tool will display a list of all the existing databases. Select the database you wish to export.<\/span><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"1350\" height=\"462\" src=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image2-3.png\" alt=\"How to export MySQL Database?, Scroll to the Databases section and select the phpMyAdmin tab 2\" class=\"wp-image-1176\" srcset=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image2-3.png 1350w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image2-3-300x103.png 300w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image2-3-1024x350.png 1024w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image2-3-768x263.png 768w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/figure>\n\n\n\n<p><span style=\"font-weight: 400;\">When the database is open, it will display a set of options on the screen\u2019s upper part. <\/span><b>Select the Export option.<\/b><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"1345\" height=\"228\" src=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image3-3.png\" alt=\"How to export MySQL Database?, Scroll to the Databases section and select the phpMyAdmin tab 3\" class=\"wp-image-1171\" srcset=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image3-3.png 1345w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image3-3-300x51.png 300w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image3-3-1024x174.png 1024w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image3-3-768x130.png 768w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/figure>\n\n\n\n<p><b>Select your preferred export method.<\/b><span style=\"font-weight: 400;\"> If you are unsure about what option to select, leave it at the default option chosen<\/span><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"1349\" height=\"426\" src=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image5-2.png\" alt=\"How to export MySQL Database?, Scroll to the Databases section and select the phpMyAdmin tab 4\" class=\"wp-image-1173\" srcset=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image5-2.png 1349w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image5-2-300x95.png 300w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image5-2-1024x323.png 1024w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image5-2-768x243.png 768w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/figure>\n\n\n\n<p><b>Click on the Go button<\/b><span style=\"font-weight: 400;\"> to start the download process.<\/span><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"1340\" height=\"432\" src=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image1-3.png\" alt=\"How to export MySQL Database?, Scroll to the Databases section and select the phpMyAdmin tab 5\" class=\"wp-image-1175\" srcset=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image1-3.png 1340w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image1-3-300x97.png 300w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image1-3-1024x330.png 1024w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/image1-3-768x248.png 768w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/figure>\n\n\n\n<p><span style=\"font-weight: 400;\">This process will export your database file to your local computer successfully.<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><b>Export MySQL Database using SSH<\/b><\/h2>\n\n\n\n<p><a href=\"https:\/\/www.scalahosting.com\/kb\/how-to-enable-ssh-access\/\"><b>SSH<\/b><\/a><b> stands for Secure Shell<\/b><span style=\"font-weight: 400;\">. It&#8217;s a network protocol that established a secure connection between a client and a server. You can use it to connect to your database and export the data from it to an SQL file saved on your server. However, you need to bear in mind that SSH is only available via the Command-Line Interface, so you need to be a bit more comfortable working with commands.<\/span><\/p>\n\n\n\n<p>After logging into the server via SSH successfully, you need to execute a command that looks like this:<\/p>\n\n\n\n<p><em><strong>$ mysqldump -p -u [your_user] [your_database] &gt; [filename].sql<\/strong><\/em><\/p>\n\n\n\n<p>So, if you have a MySQL user called <em>test_user <\/em>that has access to a database called <em>test_wp908040<\/em> and you want to export the data to <em>export.sql<\/em>, the command will look like this:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"669\" height=\"221\" src=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/361.png\" alt=\"How to export MySQL Database?, Export MySQL Database using SSH\" class=\"wp-image-4050\" srcset=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/361.png 669w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/04\/361-300x99.png 300w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/figure>\n<\/div>\n\n\n<p>After you enter the password, MySQL will export the entire database and will save it to <em>export.sql<\/em>. If you want to retrieve the file, you can do it via FTP.<\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">You can also use SSH to export a MySQL Database when working with files that are larger than 128MB.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Exporting a MySQL is vital for easy backup of important files and information within the database. When you export a database, you can import it into another database server to access the queried data. Exporting a MySQL database from your account can be done in two ways: In this article, we are going to discuss [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_seopress_robots_primary_cat":"none","_seopress_titles_title":"","_seopress_titles_desc":"Exporting a MySQL is vital for easy backup of important files and information within the database. When you export a database, you can import it into another database server to access the queried data. Exporting a MySQL database from your account can be done in two ways: Via phpMyAdmin Tool; Via SSH","_seopress_robots_index":"","footnotes":""},"categories":[34],"tags":[],"class_list":["post-1170","post","type-post","status-publish","format-standard","hentry","category-web-hosting"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/posts\/1170","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/comments?post=1170"}],"version-history":[{"count":9,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/posts\/1170\/revisions"}],"predecessor-version":[{"id":5425,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/posts\/1170\/revisions\/5425"}],"wp:attachment":[{"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/media?parent=1170"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/categories?post=1170"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/tags?post=1170"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}