{"id":309,"date":"2017-11-09T19:51:41","date_gmt":"2017-11-09T10:51:41","guid":{"rendered":"http:\/\/www.white-box.biz\/?p=309"},"modified":"2022-04-16T20:27:57","modified_gmt":"2022-04-16T11:27:57","slug":"db%e3%83%aa%e3%82%b9%e3%83%88%e3%82%a2%e6%89%8b%e9%a0%86","status":"publish","type":"post","link":"https:\/\/www.white-box.biz\/?p=309","title":{"rendered":"db\u30ea\u30b9\u30c8\u30a2\u624b\u9806"},"content":{"rendered":"<p>db\u304c\u30af\u30e9\u30c3\u30b7\u30e5\u3057\u3066\u3069\u3046\u3057\u3066\u3082\u8d77\u52d5\u3057\u306a\u3044\u3002<\/p>\n<p>\u65e5\u6642\u3067\u30d5\u30eb\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3092\u53d6\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u305d\u3053\u304b\u3089\u623b\u3057\u307e\u3059\u3002<\/p>\n<p>\u30d0\u30c3\u30af\u30a2\u30c3\u30d7<\/p>\n<blockquote><p><code><br \/>\nmysqldump -R -u user -ppassword\u00a0 dbname filename.sql.gz<br \/>\n<\/code><\/p><\/blockquote>\n<p>\u5fa9\u65e7<\/p>\n<blockquote><p><code><br \/>\nmv \/var\/lib\/mysql \/var\/lib\/mysqlcrashed\u00a0 \/\/\u5ff5\u306e\u70ba\u58ca\u308c\u305f\u3082\u306e\u3092\u79fb\u52d5<br \/>\nmkdir \/var\/lib\/mysql<br \/>\nchown mysql:mysql mysql<br \/>\nmysql_install_db --datadir=\/var\/lib\/mysql\u00a0 --user=mysql \/\/DB\u521d\u671f\u5316<br \/>\nmysql -u root<br \/>\nGRANT ALL ON *.* TO username@'%' IDENTIFIED BY 'password' WITH GRANT OPTION; \/\/\u30e6\u30fc\u30b6\u4f5c\u6210<br \/>\nGRANT ALL ON *.* TO username@localhost IDENTIFIED BY 'password' WITH GRANT OPTION;<br \/>\nexit<br \/>\nmysql -u username-p \/\/\u65b0\u3057\u3044\u30e6\u30fc\u30b6\u3067\u30ed\u30b0\u30a4\u30f3<br \/>\ncreate database dbname \/\/DB\u4f5c\u6210<br \/>\nexit<br \/>\nmysql -u username -ppassword dbname &lt; \/filename.sql \/\/\u30ea\u30b9\u30c8\u30a2<br \/>\n<\/code><\/p><\/blockquote>\n<p>\u5727\u7e2e\u3057\u3066\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3001\u30ea\u30b9\u30c8\u30a2<\/p>\n<blockquote><p><code><br \/>\nmysqldump -u user -p password dbname | gzip &gt; dbname.dump.gz<br \/>\nzcat dbname.dump.gz | mysql -u user -p password dbname<br \/>\n<\/code><\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>db\u304c\u30af\u30e9\u30c3\u30b7\u30e5\u3057\u3066\u3069\u3046\u3057\u3066\u3082\u8d77\u52d5\u3057\u306a\u3044\u3002 \u65e5\u6642\u3067\u30d5\u30eb\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3092\u53d6\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u305d\u3053\u304b\u3089\u623b\u3057\u307e\u3059\u3002 \u30d0\u30c3\u30af\u30a2\u30c3\u30d7 mysqldump -R -u user -ppassword\u00a0 dbname filename.sq<a href=\"https:\/\/www.white-box.biz\/?p=309\"><b>[\u30fb\u30fb\u30fb\u7d9a\u304d\u3092\u8aad\u3080]<\/b><\/a><\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.white-box.biz\/index.php?rest_route=\/wp\/v2\/posts\/309"}],"collection":[{"href":"https:\/\/www.white-box.biz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.white-box.biz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.white-box.biz\/index.php?rest_route=\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.white-box.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=309"}],"version-history":[{"count":16,"href":"https:\/\/www.white-box.biz\/index.php?rest_route=\/wp\/v2\/posts\/309\/revisions"}],"predecessor-version":[{"id":2356,"href":"https:\/\/www.white-box.biz\/index.php?rest_route=\/wp\/v2\/posts\/309\/revisions\/2356"}],"wp:attachment":[{"href":"https:\/\/www.white-box.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=309"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.white-box.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=309"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.white-box.biz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=309"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}