{"id":64,"date":"2015-09-08T13:28:20","date_gmt":"2015-09-08T10:28:20","guid":{"rendered":"http:\/\/small-service.com\/?p=64"},"modified":"2016-03-09T12:27:15","modified_gmt":"2016-03-09T09:27:15","slug":"backup-mysql-databases","status":"publish","type":"post","link":"https:\/\/small-service.com\/?p=64","title":{"rendered":"backup mysql databases"},"content":{"rendered":"<h6>steps to perform mysql databases backup:<\/h6>\n<ul>\n<li>put the server\u00a0 in a read-only state:<br \/>\n<code>FLUSH TABLES WITH READ LOCK;<br \/>\nSET GLOBAL read_only = ON;<\/code><\/li>\n<li>backup data via\u00a0<a href=\"http:\/\/small-service.com\/?p=65\" target=\"_blank\">this script<\/a>\u00a0or:<br \/>\n<code>mysqldump -h <em>host_name<\/em> --user=<em>user_name<\/em> --password=<em>password<\/em> --events --opt --single-transaction <em>db_for_backup<\/em> | gzip &gt; <em>backup_name.gz<\/em> <\/code><\/li>\n<li>turn off read-only mode:<br \/>\n<code>SET GLOBAL read_only = OFF;<br \/>\nUNLOCK TABLES;<\/code><\/li>\n<\/ul>\n<h6>to restore db from backup:<\/h6>\n<ul>\n<li>you can use\u00a0<a href=\"http:\/\/small-service.com\/?p=70\" target=\"_blank\">this script<\/a><\/li>\n<li>or:\u00a0<code> mysql -u <em>user<\/em> <em>\"db_name\"<\/em> &lt; <em>backup_name<\/em> <\/code><\/li>\n<li>or: <code> gunzip < <em>backup_name.gz<\/em> | mysql -u <em>user<\/em> -p<em> password<\/em> <em>db_name<\/em> <\/code><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>steps to perform mysql databases backup: put the server\u00a0 in a read-only state: FLUSH TABLES WITH READ LOCK; SET GLOBAL read_only = ON; backup data via\u00a0this script\u00a0or: mysqldump -h host_name &#8211;user=user_name &#8211;password=password &#8211;events &#8211;opt &#8211;single-transaction db_for_backup | gzip &gt; backup_name.gz turn off read-only mode: SET GLOBAL read_only = OFF; UNLOCK TABLES; to restore db from [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[15],"tags":[37,35,38,41],"_links":{"self":[{"href":"https:\/\/small-service.com\/index.php?rest_route=\/wp\/v2\/posts\/64"}],"collection":[{"href":"https:\/\/small-service.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/small-service.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/small-service.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/small-service.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=64"}],"version-history":[{"count":5,"href":"https:\/\/small-service.com\/index.php?rest_route=\/wp\/v2\/posts\/64\/revisions"}],"predecessor-version":[{"id":78,"href":"https:\/\/small-service.com\/index.php?rest_route=\/wp\/v2\/posts\/64\/revisions\/78"}],"wp:attachment":[{"href":"https:\/\/small-service.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=64"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/small-service.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=64"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/small-service.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=64"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}