{"id":1470,"date":"2021-12-24T11:33:15","date_gmt":"2021-12-24T11:33:15","guid":{"rendered":"https:\/\/ownwebservers.com\/kb\/?p=1470"},"modified":"2021-12-24T12:27:35","modified_gmt":"2021-12-24T12:27:35","slug":"back-up-and-restore-a-database-on-dedicated-server-using-ssh","status":"publish","type":"post","link":"https:\/\/ownwebservers.com\/kb\/back-up-and-restore-a-database-on-dedicated-server-using-ssh\/","title":{"rendered":"Back up and restore a database on Dedicated server using SSH"},"content":{"rendered":"<p>Using SSH, on Dedicated server how can i back up a database.<\/p>\n<p>Follow the steps as explain below to back-up the <strong>MySQL database<\/strong> on a <a href=\"https:\/\/ownwebservers.com\/dedicated-hosting\/\">Linux dedicated server<\/a> using SSH.<\/p>\n<p>Step 1 : First step is to log-in to your linux dedicated server using SSH<\/p>\n<p>Step 2: Then, to take backup of the MySQL Database use the below command<\/p>\n<blockquote><p>mysqldump -h host -u&lt;databaseuser&gt; -p [&lt;<em>NameofDatabase<\/em>&gt;]\u00a0 &gt; BACKUP.sql<\/p><\/blockquote>\n<p>Note : Here you need to replace \u201c[&lt;NameofDatabase&gt;]\u201d with the &lt;<strong>exact name<\/strong>&gt; of your current database which you intend to backup.<\/p>\n<p>With these simple steps you&#8217;ll be able to simply take backup of your database, wherever the file created would be BackUp.sql.<\/p>\n<h3>Q :\u00a0How can I restore a database on Dedicated server using SSH ?<\/h3>\n<p>Now whenever required you can restore it as well as now you have the backup file.<\/p>\n<p>To do so, you need to follow few easy steps as explained below.<\/p>\n<p>Step 1 : Logged into your dedicated server as root using SSH<\/p>\n<p>Step 2 : Find the dump file of the MySQL database.<\/p>\n<p>Step 3 : Then, manually enter the below shown command for importing it into the chosen database :<\/p>\n<blockquote><p>mysql -h host -u&lt;databaseuser&gt; -p [&lt;<em>NameofDatabase<\/em>&gt;]\u00a0 &lt; BACKUP.sql<\/p><\/blockquote>\n<p>NOTE : Replace \u201c[&lt;<span style=\"color: #3366ff;\">NameofDatabase<\/span>&gt;]\u201d with the &lt;<strong>exact name<\/strong>&gt; of the database backup file (here it is BACKUP.sql) for restoration.<\/p>\n<p>If the dump file of the database contains a \u201cCREATE DATABASE\u201c clause, in that case, you must remove this line from the dump file. For these use any text editor.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Using SSH, on Dedicated server how can i back up a database. Follow the steps as explain below to back-up the MySQL database on a Linux dedicated server using SSH. Step 1 : First step is to log-in to your linux dedicated server using SSH Step 2: Then, to take backup of the MySQL Database [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-1470","post","type-post","status-publish","format-standard","hentry","category-dedicated-server"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v15.2.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Back up and restore a database on Dedicated server using SSH - OWS KB<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ownwebservers.com\/kb\/back-up-and-restore-a-database-on-dedicated-server-using-ssh\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Back up and restore a database on Dedicated server using SSH - OWS KB\" \/>\n<meta property=\"og:description\" content=\"Using SSH, on Dedicated server how can i back up a database. Follow the steps as explain below to back-up the MySQL database on a Linux dedicated server using SSH. Step 1 : First step is to log-in to your linux dedicated server using SSH Step 2: Then, to take backup of the MySQL Database [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ownwebservers.com\/kb\/back-up-and-restore-a-database-on-dedicated-server-using-ssh\/\" \/>\n<meta property=\"og:site_name\" content=\"OWS KB\" \/>\n<meta property=\"article:published_time\" content=\"2021-12-24T11:33:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-12-24T12:27:35+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\">\n\t<meta name=\"twitter:data1\" content=\"admin\">\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\">\n\t<meta name=\"twitter:data2\" content=\"1 minute\">\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/#website\",\"url\":\"https:\/\/ownwebservers.com\/kb\/\",\"name\":\"OWS KB\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/ownwebservers.com\/kb\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/back-up-and-restore-a-database-on-dedicated-server-using-ssh\/#webpage\",\"url\":\"https:\/\/ownwebservers.com\/kb\/back-up-and-restore-a-database-on-dedicated-server-using-ssh\/\",\"name\":\"Back up and restore a database on Dedicated server using SSH - OWS KB\",\"isPartOf\":{\"@id\":\"https:\/\/ownwebservers.com\/kb\/#website\"},\"datePublished\":\"2021-12-24T11:33:15+00:00\",\"dateModified\":\"2021-12-24T12:27:35+00:00\",\"author\":{\"@id\":\"https:\/\/ownwebservers.com\/kb\/#\/schema\/person\/4a40fe3fe17a08ddd1d7c113668e75f2\"},\"breadcrumb\":{\"@id\":\"https:\/\/ownwebservers.com\/kb\/back-up-and-restore-a-database-on-dedicated-server-using-ssh\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ownwebservers.com\/kb\/back-up-and-restore-a-database-on-dedicated-server-using-ssh\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/back-up-and-restore-a-database-on-dedicated-server-using-ssh\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/\",\"url\":\"https:\/\/ownwebservers.com\/kb\/\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"position\":2,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/back-up-and-restore-a-database-on-dedicated-server-using-ssh\/\",\"url\":\"https:\/\/ownwebservers.com\/kb\/back-up-and-restore-a-database-on-dedicated-server-using-ssh\/\",\"name\":\"Back up and restore a database on Dedicated server using SSH\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/#\/schema\/person\/4a40fe3fe17a08ddd1d7c113668e75f2\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ba5db5841d48bd7517bb2583e13983e6d2fa56a4099a0b3c61ad2daefc321303?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"sameAs\":[\"https:\/\/ownwebservers.com\/kb\"]}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","_links":{"self":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts\/1470","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/comments?post=1470"}],"version-history":[{"count":3,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts\/1470\/revisions"}],"predecessor-version":[{"id":1473,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts\/1470\/revisions\/1473"}],"wp:attachment":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/media?parent=1470"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/categories?post=1470"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/tags?post=1470"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}