{"id":1154,"date":"2020-11-25T13:57:33","date_gmt":"2020-11-25T13:57:33","guid":{"rendered":"https:\/\/blog.hostinger.io\/support\/2020\/11\/25\/4664708-how-to-export-a-database-over-ssh-on-cpanel-at-hostinger\/"},"modified":"2026-03-16T12:12:12","modified_gmt":"2026-03-16T12:12:12","slug":"4664708-how-to-export-a-database-over-ssh-on-cpanel-at-hostinger","status":"publish","type":"post","link":"https:\/\/www.hostinger.com\/support\/4664708-how-to-export-a-database-over-ssh-on-cpanel-at-hostinger\/","title":{"rendered":"How to Export a Database over SSH on cPanel at Hostinger"},"content":{"rendered":"<p class=\"no-margin\">If you encountered difficulties <b><a href=\"\/support\/4549740-how-to-export-a-phpmyadmin-database-on-cpanel\" target=\"_blank\" class=\"intercom-content-link\">exporting a database<\/a><\/b> through phpMyAdmin, you can export your database using <b>SSH<\/b>. Just follow these steps: <\/p><p class=\"no-margin\">\n<\/p><h2 id=\"step-1---preparation\">Step 1 &ndash; Preparation<\/h2><ul>\n<li>\n<p class=\"no-margin\">Gather your <b><a href=\"\/support\/4719044-how-to-find-your-mysql-database-details-on-cpanel\" target=\"_blank\" class=\"intercom-content-link\">database details<\/a><\/b>: database name, user and password. <\/p>\n<\/li>\n<li>\n<p class=\"no-margin\">If you have forgotten your database password, follow this guide: <b><a href=\"\/support\/4719059-how-to-a-change-a-database-password-on-cpanel\" target=\"_blank\" class=\"intercom-content-link\">How to a Change a Database Password on cPanel<\/a><\/b><\/p>\n<\/li>\n<\/ul><p class=\"no-margin\">\n<\/p><h2 id=\"step-2---connecting\">Step 2 &ndash; Connecting via SSH<\/h2><ul>\n<li>\n<p class=\"no-margin\">Connect to your <b><a href=\"\/support\/4622295\" target=\"_blank\" class=\"intercom-content-link\">hosting via SSH<\/a><\/b><\/p>\n<\/li>\n<li>\n<p class=\"no-margin\">Use the <code>ls<\/code> command to ensure you are in the <b>root directory<\/b>, that is, <b>public_html<\/b>. If you are in a different directory, use the <code>ls<\/code> and <code>cd<\/code> commands to navigate to the correct location<\/p>\n<\/li>\n<\/ul><h2 id=\"step-3---export\">Step 3 &ndash; Export the Database<\/h2><p class=\"no-margin\">Use this command to <b>export the database<\/b>:<\/p><p class=\"no-margin\">\n<\/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>MySQL Database name<\/b>: user_database<\/p>\n<\/li>\n<li>\n<p class=\"no-margin\"><b>MySQL Username<\/b>: user_admin<\/p>\n<\/li>\n<li>\n<p class=\"no-margin\"><b>Uploaded database file<\/b>: backup.sql<\/p>\n<\/li>\n<\/ul><p class=\"no-margin\">The command will look like this:<\/p><p class=\"no-margin\">\n<\/p><pre><code>mysqldump -u user_admin -p user_database &gt; backup.sql<\/code><\/pre><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">After that you will need to <b>enter the database password<\/b> &ndash; the exporting process will start. The export will take some time depending on the size of your database. When it is completed, a new line will appear:<\/p><p class=\"no-margin\">\n<\/p><pre><code>-bash-4.2$<\/code><\/pre><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">This line means that the exporting process is done. You can verify that your database file is available on the location using the <b><a href=\"\/support\/4622321-basic-actions-in-cpanel-file-manager\" target=\"_blank\" class=\"intercom-content-link\">File Manager<\/a><\/b>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Exporting a database over SSH using cPanel<\/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":[195],"tags":[],"class_list":["post-1154","post","type-post","status-publish","format-standard","hentry","category-mysql"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/support\/4664708-how-to-export-a-database-over-ssh-on-cpanel-at-hostinger\/","default":1},{"locale":"fr-FR","link":"https:\/\/www.hostinger.com\/fr\/support\/4664708-comment-exporter-une-base-de-donnees-par-ssh-sur-cpanel-chez-hostinger\/","default":0},{"locale":"id-ID","link":"https:\/\/www.hostinger.com\/id\/support\/4664708-bagaimana-cara-mengekspor-database-melalui-ssh-di-cpanel-di-hostinger\/","default":0},{"locale":"pt-PT","link":"https:\/\/www.hostinger.com\/br\/support\/4664708-como-faco-para-exportar-um-banco-de-dados-por-ssh-no-cpanel-hostinger\/","default":0}],"include_on_kodee":true,"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/1154","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=1154"}],"version-history":[{"count":0,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/1154\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/media?parent=1154"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/categories?post=1154"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/tags?post=1154"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}