{"id":345,"date":"2016-11-28T10:20:54","date_gmt":"2016-11-28T10:20:54","guid":{"rendered":"https:\/\/www.xsofthost.com\/help\/?p=345"},"modified":"2017-02-10T10:29:39","modified_gmt":"2017-02-10T10:29:39","slug":"how-to-import-export-mysql-database-using-ssh-connection","status":"publish","type":"post","link":"https:\/\/www.xsofthost.com\/help\/how-to-import-export-mysql-database-using-ssh-connection\/","title":{"rendered":"How to Import Export MySQL database using SSH connection"},"content":{"rendered":"<h2>Commands on Linux to Import\/Export MySQL<\/h2>\n<p>Frist login to your server using SSH <br \/>\n then you have to run some commands for import\/export MySQL database<br \/>\n <strong>Note:<\/strong>you need to know the database username and password<br \/>\n <em><strong><br \/>\n <\/strong><\/em><strong>to simulate an exmaple lets consider the following:<\/strong><em><strong><\/p>\n<p> <\/strong><\/em><\/p>\n<ul>\n<li><strong>dbusername<\/strong>: cpnluser_user as a database user example, cpnluser as a cPanel username example.<\/li>\n<li><strong>dbpassword<\/strong>: mypwd123.<\/li>\n<li><strong>dbname<\/strong>: cpnluser_database as database name<\/li>\n<li><strong>path to the file<\/strong>: \/home\/cpnluser\/public_html\/databases\/db_file.sql as location of import\/export file path.<\/li>\n<\/ul>\n<h3>Database import<\/h3>\n<p><em><code>mysql -u cpnluser_user -pmypwd123 cpnluser_database &lt; \/home\/cpnluser\/public_html\/databases\/db_file.sql <\/code><\/em><br \/>\n <em>or<\/em><br \/>\n <em><code>mysql -u cpnluser_user -p cpnluser_database &lt; \/home\/nctests\/public_html\/cpnluser\/db_file.sql<\/code><br \/>\n then ssh will ask your for the cpnluser<\/em>_user password<em><br \/>\n <\/em><\/p>\n<h3>Database export<\/h3>\n<p><em><code>mysqldump -u cpnluser_user -pmypwd123 cpnluser_database &gt; \/home\/cpnluser\/public_html\/databases\/db_file.sql <\/code><br \/>\n or<br \/>\n <\/em> <em><code>mysqldump -u <em>cpnluser<\/em>_user -p <em>cpnluser<\/em>_database &gt; \/home\/<em>cpnluser<\/em>\/public_html\/databases\/db_file.sql <br \/>\n <\/code><\/em><em>then ssh will ask your for the cpnluser_user password<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Commands on Linux to Import\/Export MySQL Frist login to your server using SSH then you have to run some commands for import\/export MySQL database Note:you need to know the database username and password to simulate an exmaple lets consider the following: dbusername: cpnluser_user as a database user example, cpnluser as a cPanel username example. dbpassword: [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":50,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[41,25],"tags":[42,26],"_links":{"self":[{"href":"https:\/\/www.xsofthost.com\/help\/wp-json\/wp\/v2\/posts\/345"}],"collection":[{"href":"https:\/\/www.xsofthost.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xsofthost.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xsofthost.com\/help\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xsofthost.com\/help\/wp-json\/wp\/v2\/comments?post=345"}],"version-history":[{"count":1,"href":"https:\/\/www.xsofthost.com\/help\/wp-json\/wp\/v2\/posts\/345\/revisions"}],"predecessor-version":[{"id":346,"href":"https:\/\/www.xsofthost.com\/help\/wp-json\/wp\/v2\/posts\/345\/revisions\/346"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.xsofthost.com\/help\/wp-json\/wp\/v2\/media\/50"}],"wp:attachment":[{"href":"https:\/\/www.xsofthost.com\/help\/wp-json\/wp\/v2\/media?parent=345"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xsofthost.com\/help\/wp-json\/wp\/v2\/categories?post=345"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xsofthost.com\/help\/wp-json\/wp\/v2\/tags?post=345"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}