{"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-10-15T08:33:14","modified_gmt":"2026-10-15T08:33:14","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\">Export a database over SSH in Hostinger when the database is too large for phpMyAdmin, or when a phpMyAdmin export fails. Gather your database details, connect to your hosting plan via SSH, and run the mysqldump command to create an .sql backup file.<\/p><h2 id=\"step-1---preparation\">Step 1 &ndash; Preparation<\/h2><p class=\"no-margin\">Gather your <b><a data-click-id=\"hgr-post-content-link-database-details\" class=\"intercom-content-link\" href=\"https:\/\/www.hostinger.com\/support\/1583552-how-to-find-your-mysql-database-details-in-hostinger\/\" target=\"_blank\" rel=\"noopener\">database details<\/a><\/b>: database name, user and password. If you don&rsquo;t remember the database password, you can <b><a data-click-id=\"hgr-post-content-link-change-it\" class=\"intercom-content-link\" href=\"https:\/\/www.hostinger.com\/support\/1583522-how-to-change-a-database-password-in-hostinger\/\" target=\"_blank\" rel=\"noopener\">change it<\/a><\/b>.<\/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 data-click-id=\"hgr-post-content-link-enabled\" class=\"intercom-content-link\" href=\"https:\/\/www.hostinger.com\/support\/1583645-how-to-enable-ssh-access-in-hostinger\/\" target=\"_blank\" rel=\"noopener\">enabled<\/a><\/b><\/p>\n<\/li>\n<li>\n<p class=\"no-margin\">Connect to your <b><a data-click-id=\"hgr-post-content-link-hosting-via-ssh\" class=\"intercom-content-link\" href=\"https:\/\/www.hostinger.com\/support\/1583245-how-to-connect-to-a-hosting-plan-via-ssh-in-hostinger\/\" target=\"_blank\" rel=\"noopener\">hosting via SSH<\/a><\/b><\/p>\n<\/li>\n<li>\n<p class=\"no-margin\">Open your <b><a data-click-id=\"hgr-post-content-link-root-directory\" class=\"intercom-content-link\" href=\"https:\/\/www.hostinger.com\/support\/5973000-how-to-open-the-website-s-root-directory-via-ssh-in-hostinger\/\" target=\"_blank\" rel=\"noopener\">root directory<\/a> <\/b>(public_html)<\/p>\n<\/li>\n<\/ol><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\">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\">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\">Your database is now exported to the .sql backup file in your website&rsquo;s root directory. To export a database without the command line, you can also <a data-click-id=\"hgr-post-content-link-export-a-database-with-phpmyadmin\" href=\"https:\/\/www.hostinger.com\/support\/4529011-how-to-export-a-database-with-phpmyadmin-in-hostinger\/\">export a database with phpMyAdmin<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Export a database over SSH in Hostinger: gather your database details, connect via SSH, and run mysqldump to create an .sql backup file.<\/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-BR","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-\u044f\u043a-\u0435\u043a\u0441\u043f\u043e\u0440\u0442\u0443\u0432\u0430\u0442\u0438-\u0431\u0430\u0437\u0443-\u0434\u0430\u043d\u0438\u0445-\u0447\u0435\u0440\u0435\u0437-ssh-\u0443-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":4,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/1182\/revisions"}],"predecessor-version":[{"id":20726,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/1182\/revisions\/20726"}],"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}]}}