{"id":26101,"date":"2020-12-07T14:03:50","date_gmt":"2020-12-07T05:03:50","guid":{"rendered":"https:\/\/tadtadya.com\/en\/?p=26101"},"modified":"2021-01-25T14:49:25","modified_gmt":"2021-01-25T05:49:25","slug":"mysql-mariadb-how-to-restore-2","status":"publish","type":"post","link":"https:\/\/tadtadya.com\/en\/mysql-mariadb-how-to-restore-2\/","title":{"rendered":"MySQL\/MariaDB, How to Restore"},"content":{"rendered":"\n<p>Restoring MySQL is as simple as running the 'mysql' command from the backup file and restoring the database data.<\/p>\n\n\n\n<p>The same is true for MariaDB.<\/p>\n\n\n\n<!--more-->\n\n\n\n<div class=\"wp-block-origin-block-msg-box\"><div class=\"msgbox msgbox-notice v1\"><i class=\"fas fa-exclamation-triangle icon\"><\/i><div class=\"msg\">\n<p>This is written by a Japanese who can't speak English with the help of translation application. Sorry if it's not good.<\/p>\n<\/div><\/div><\/div>\n\n\n\n<p>The backup files used to restore the database are easy to create.<\/p>\n\n\n\n<div class=\"wp-block-origin-block-a-link-ext alk-ex\"><a href=\"https:\/\/tadtadya.com\/en\/mysql-mariadb-how-to-backup-2\/\" title=\"MySQL\/MariaDB, How to backup\"><strong>MySQL\/MariaDB, How to backup<\/strong> <i class=\"fas fa-angle-double-right\"><\/i><\/a><\/div>\n\n\n\n<p>Backup files should be made periodically. I mean, a database that doesn't do this is dangerous.<\/p>\n\n\n\n<p>And when something happens, run the restore command.<\/p>\n\n\n\n<div class=\"wp-block-origin-block-em-box em-group em-group-format block\">\n<div class=\"pre-code-title\"><\/div><pre class=\"\" data-user=\"root\" data-output=\"\"><code class=\"language-bash\">mysql -uuser -ppassword db_name &lt; backup.sql<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-table aligncenter\"><table><tbody><tr><td>user<\/td><td>DB connection user<\/td><\/tr><tr><td>password<\/td><td>DB connection password<\/td><\/tr><tr><td>db_name<\/td><td>Database Name<\/td><\/tr><tr><td>backup.sql<\/td><td>Backup File Name<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n\n<h2 class=\"is-style-h2df\">Options<\/h2>\n\n\n\n<h3 class=\"is-style-h3df\">-u<\/h3>\n\n\n\n<p>Database connection user name<\/p>\n\n\n\n<h3 class=\"is-style-h3df\">-p<\/h3>\n\n\n\n<p>Database connection password<\/p>\n\n\n\n<hr class=\"wp-block-separator is-style-dots\"\/>\n\n\n\n<hr class=\"wp-block-separator is-style-dots\"\/>\n\n\n\n<p>Enter the contents of the backup.sql file into the 'mysql' command in the redirection to update the contents of the database.<\/p>\n\n\n\n<div class=\"wp-block-origin-block-em-box em-group em-group-link em-group-related\">\n<div class=\"wp-block-origin-block-blog-card blog-card\"><div class=\"img\"><img decoding=\"async\" src=\"https:\/\/i0.wp.com\/tadtadya.com\/en\/wp-content\/uploads\/sites\/2\/2020\/12\/mysql-marriadb-logo-en.png?ssl=1\" alt=\"MySQL\/MariaDB logo\" data-recalc-dims=\"1\"\/><\/div><div class=\"text\"><h2 class=\"title\">MySQL\/MariaDB, How to backup<\/h2><div class=\"content\"><\/div><small class=\"host\">tadtadya.com\/en<\/small><\/div><a href=\"https:\/\/tadtadya.com\/en\/mysql-mariadb-how-to-backup-2\/\" title=\"MySQL\/MariaDB, How to backup\"><\/a><\/div>\n<\/div>\n\n<!-- WP QUADS Content Ad Plugin v. 2.0.65.1 -->\n<div class=\"quads-location quads-ad2\" id=\"quads-ad2\" style=\"float:none;margin:0px;\">\n<ul class=\"quads-location-ul\">\r\n<li class=\"quads-location-li li-1\">\r\n<script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\r\n<ins class=\"adsbygoogle\"\r\n     style=\"display:block\"\r\n     data-ad-client=\"ca-pub-4926008942376207\"\r\n     data-ad-slot=\"6550760310\"\r\n     data-ad-format=\"auto\"\r\n     data-full-width-responsive=\"true\"><\/ins>\r\n<script>\r\n     (adsbygoogle = window.adsbygoogle || []).push({});\r\n<\/script>\r\n<\/li>\r\n<li class=\"quads-location-li li-2\">\r\n<script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\r\n<ins class=\"adsbygoogle\"\r\n     style=\"display:block\"\r\n     data-ad-client=\"ca-pub-4926008942376207\"\r\n     data-ad-slot=\"6550760310\"\r\n     data-ad-format=\"auto\"\r\n     data-full-width-responsive=\"true\"><\/ins>\r\n<script>\r\n     (adsbygoogle = window.adsbygoogle || []).push({});\r\n<\/script>\r\n<\/li>\r\n<\/ul>\n<\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>Restoring MySQL is as simple as running the 'mysql' command from the backup file and restoring the database data. The same is true for MariaDB.<\/p>\n","protected":false},"author":1,"featured_media":26093,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"jetpack_publicize_message":"You should look at the official documentation. But here's how to restore MySQL.\n\nSame with MariaDB.\n\n#MySQL\n#MariaDB\n","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_options":[]},"categories":[9,389,390],"tags":[548,549,551],"jetpack_publicize_connections":[],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/tadtadya.com\/en\/wp-content\/uploads\/sites\/2\/2020\/12\/mysql-marriadb-logo-en.png?fit=1280%2C671&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8Qw77-6MZ","jetpack_likes_enabled":false,"_links":{"self":[{"href":"https:\/\/tadtadya.com\/en\/wp-json\/wp\/v2\/posts\/26101"}],"collection":[{"href":"https:\/\/tadtadya.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tadtadya.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tadtadya.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tadtadya.com\/en\/wp-json\/wp\/v2\/comments?post=26101"}],"version-history":[{"count":0,"href":"https:\/\/tadtadya.com\/en\/wp-json\/wp\/v2\/posts\/26101\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tadtadya.com\/en\/wp-json\/wp\/v2\/media\/26093"}],"wp:attachment":[{"href":"https:\/\/tadtadya.com\/en\/wp-json\/wp\/v2\/media?parent=26101"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tadtadya.com\/en\/wp-json\/wp\/v2\/categories?post=26101"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tadtadya.com\/en\/wp-json\/wp\/v2\/tags?post=26101"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}