{"id":1182,"date":"2020-10-14T13:46:55","date_gmt":"2020-10-14T13:46:55","guid":{"rendered":"https:\/\/blog.hostinger.io\/support\/2020\/10\/14\/4536328-how-to-export-a-database-over-ssh-in-hostinger\/"},"modified":"2026-03-16T12:12:13","modified_gmt":"2026-03-16T12:12:13","slug":"4536328-how-to-export-a-database-over-ssh-in-hostinger","status":"publish","type":"post","link":"https:\/\/www.hostinger.com\/support\/4536328-how-to-export-a-database-over-ssh-in-hostinger\/","title":{"rendered":"How to Export a Database Over SSH in Hostinger"},"content":{"rendered":"<p class=\"no-margin\">If you want to export a large database, or if you encountered difficulties <b><a href=\"\/support\/4529011-how-to-export-a-phpmyadmin-database\" target=\"_blank\" class=\"intercom-content-link\">exporting a database<\/a><\/b> through phpMyAdmin, you can export your database using <b>SSH<\/b> by following these steps:<\/p><p class=\"no-margin\">\n<\/p><h2 id=\"step-1---preparation\">Step 1 &ndash; Preparation<\/h2><p class=\"no-margin\">Gather your <b><a href=\"\/support\/1583552-how-to-find-your-mysql-database-details\" target=\"_blank\" class=\"intercom-content-link\">database details<\/a><\/b>: database name, user and password. If you don&rsquo;t remember the database password, you can <b><a href=\"\/support\/1583522-how-to-change-a-database-password\" target=\"_blank\" class=\"intercom-content-link\">change it<\/a><\/b>.<\/p><p class=\"no-margin\">\n<\/p><h2 id=\"step-2---connecting\">Step 2 &ndash; Connect to SSH<\/h2><ol>\n<li>\n<p class=\"no-margin\">Make sure SSH is <b><a href=\"\/support\/1583645-how-to-enable-ssh-access\" target=\"_blank\" class=\"intercom-content-link\">enabled<\/a><\/b><\/p>\n<\/li>\n<li>\n<p class=\"no-margin\">Connect to your <b><a href=\"\/support\/1583245\" target=\"_blank\" class=\"intercom-content-link\">hosting via SSH<\/a><\/b><\/p>\n<\/li>\n<li>\n<p class=\"no-margin\">Open your <b><a href=\"\/support\/5973000-how-to-open-the-website-s-root-directory-via-ssh\" target=\"_blank\" class=\"intercom-content-link\">root directory<\/a> <\/b>(public_html)<\/p>\n<\/li>\n<\/ol><p class=\"no-margin\">\n<\/p><h2 id=\"step-3---export\">Step 3 &ndash; Export the Database<\/h2><p class=\"no-margin\">Use the following command to <b>export the database<\/b>:<\/p><pre><code>mysqldump -u database_username -p database_name &gt; file.sql<\/code><\/pre><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">For example, if the <b>parameters of your database<\/b> are:<\/p><ul>\n<li>\n<p class=\"no-margin\"><b>Database name<\/b>: u123456789_database<\/p>\n<\/li>\n<li>\n<p class=\"no-margin\"><b>Username<\/b>: u123456789_admin <\/p>\n<\/li>\n<li>\n<p class=\"no-margin\"><b>Exported database backup name<\/b>: backup.sql<\/p>\n<\/li>\n<\/ul><p class=\"no-margin\">The command will look like this:<\/p><pre><code>mysqldump -u u123456789_admin -p u123456789_database &gt; backup.sql<\/code><\/pre><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">After that, you will be prompted to <b>enter the database password<\/b>, and the exporting process will start. Keep in mind that the time it will take may vary depending on the size of your database.<\/p><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">That&rsquo;s it! Now you know how to export your database through SSH &#128522;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Exporting a database over SSH<\/p>\n","protected":false},"author":581,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"include_on_kodee":true,"footnotes":""},"categories":[243],"tags":[],"class_list":["post-1182","post","type-post","status-publish","format-standard","hentry","category-importing-and-exporting-databases"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/support\/4536328-how-to-export-a-database-over-ssh-in-hostinger\/","default":1},{"locale":"id-ID","link":"https:\/\/www.hostinger.com\/id\/support\/4536328-bagaimana-cara-mengekspor-database-phpmyadmin-di-hostinger\/","default":0},{"locale":"lt-LT","link":"https:\/\/www.hostinger.com\/lt\/support\/4536328-kaip-eksportuoti-duomenu-baze-per-ssh-hostinger-platformoje\/","default":0},{"locale":"pt-PT","link":"https:\/\/www.hostinger.com\/br\/support\/4536328-como-faco-para-exportar-um-banco-de-dados-por-ssh-no-hostinger\/","default":0},{"locale":"uk-UA","link":"https:\/\/www.hostinger.com\/ua\/support\/4536328------ssh--hostinge\/","default":0}],"include_on_kodee":true,"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/1182","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/users\/581"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/comments?post=1182"}],"version-history":[{"count":0,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/1182\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/media?parent=1182"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/categories?post=1182"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/tags?post=1182"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}