{"id":6920,"date":"2022-05-01T16:02:35","date_gmt":"2022-05-01T07:02:35","guid":{"rendered":"https:\/\/east19-mikas.com\/?p=6920"},"modified":"2024-08-01T10:47:54","modified_gmt":"2024-08-01T01:47:54","slug":"db%e3%81%ae%e5%a4%89%e6%9b%b4%e3%81%a8%e3%83%87%e3%82%a3%e3%83%ac%e3%82%af%e3%83%88%e3%83%aa%e5%a4%89%e6%9b%b4","status":"publish","type":"post","link":"https:\/\/east19-mikas.com\/mpat\/?p=6920","title":{"rendered":"DB\u306e\u5909\u66f4\u3068\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u5909\u66f4"},"content":{"rendered":"\n<p class=\"has-medium-font-size\">\u3088\u304f\u6709\u308b\u4e8b\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u3001\u4f7f\u7528\u3057\u3066\u3044\u305fDB\u540d\u304c\u91cd\u306a\u308a\u3001\u4e14\u3064\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3082\u540c\u3058\u3060\u3063\u305f\u305f\u3081\u3001\u30c6\u30b9\u30c8\u30b5\u30fc\u30d0\u30fc\u306eDB\u540d\u5909\u66f4\u3068\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u5909\u66f4\u3092\u8a66\u307f\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u5909\u66f4\u65b9\u6cd5<\/h2>\n\n\n\n<p>\u4f7f\u7528\u3057\u3066\u3044\u305f\u30c7\u30fc\u30bf\u30fc\u30d9\u30fc\u30b9\u540d\u3092 mput1 \u304b\u3089 mpst \u306b\u5909\u66f4\u3057\u307e\u3059\u3002\u307e\u305a\u30ea\u30e2\u30fc\u30c8\u63a5\u7d9a\u3057\u3066\u304b\u3089\u3001Mysql\u306b\u30ed\u30b0\u30a4\u30f3\u3057\u3001\u4f7f\u7528\u3057\u3066\u3044\u308b\u30c7\u30fc\u30bf\u30fc\u30d9\u30fc\u30b9\u3092 sql \u30d5\u30a1\u30a4\u30eb\u306b\u5410\u304d\u51fa\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"has-background\" style=\"background-color:#444444\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-white-color\">SQL\u30d5\u30a1\u30a4\u30eb\u3092\u62bd\u51fa\u3059\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u79fb\u52d5\u3057\u3066\u304b\u3089\u4f5c\u696d\u3057\u307e\u3059<br># <\/mark><mark style=\"background-color:rgba(0, 0, 0, 0);color:#ffff00\" class=\"has-inline-color\">cd \/home\/<\/mark><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-white-color\"><br># <\/mark><mark style=\"background-color:rgba(0, 0, 0, 0);color:#ffff00\" class=\"has-inline-color\">mysqldump -h localhost -u root -p &#8211;add-drop-table mput1 > mput1.sql<\/mark><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-white-color\"><br>Enter password\u3000\u3000\u3000\u3000\u3000\u3000\uff1c\uff1d\uff1d\uff1dDB\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5165\u529b\u3057\u307e\u3059<br># <\/mark><mark style=\"background-color:rgba(0, 0, 0, 0);color:#ffff00\" class=\"has-inline-color\">ll<\/mark><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-white-color\"><br>\u5408\u8a08 369444<br>\u30fb\u30fb\u30fb\u7701\u7565\u30fb\u30fb\u30fb<br>-rw-r&#8211;r&#8211;. 1 root   root    38081046  5\u6708  1 13:06 mput1.sql<br>\u51fa\u529b\u3057\u305f sql \u30d5\u30a1\u30a4\u30eb\u3092\u7de8\u96c6PC\u306b\u30b3\u30d4\u30fc\u3057\u307e\u3059<br># <\/mark><mark style=\"background-color:rgba(0, 0, 0, 0);color:#ffff00\" class=\"has-inline-color\">scp .\/mput1.sql [user_name]@192.168.21.2:\/home\/[user_name]\/<\/mark><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-white-color\"><br><br>\u6b21\u306f\u7de8\u96c6\u30d1\u30bd\u30b3\u30f3\u3067\u306e\u4f5c\u696d\u3067\u3059<\/mark><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Mouspad\u3067 mput1.sql \u30d5\u30a1\u30a4\u30eb\u306eDB\u540d\u3092\u691c\u7d22\u30fb\u7f6e\u63db\u3057\u307e\u3059<\/h3>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/east19-mikas.com\/mput\/wp-content\/uploads\/2022\/05\/db-replase-1.png\" alt=\"\" class=\"wp-image-6933\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/east19-mikas.com\/mput\/wp-content\/uploads\/2022\/05\/replase1-1.png\" alt=\"\" class=\"wp-image-6934\"\/><\/figure>\n\n\n\n<p>\u30c7\u30fc\u30bf\u30fc\u30d9\u30fc\u30b9\u540d mput1 \u3092\u691c\u7d22\u3057\u3001197\u500b\u3042\u308b mput1 \u3092 mpst \u306b\u6587\u5b57\u5217\u7f6e\u63db\u3057\u307e\u3059<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">URL \u3092 \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5148\u306e URL \u306b\u7f6e\u63db\u3057\u307e\u3059<\/h3>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/east19-mikas.com\/mput\/wp-content\/uploads\/2022\/05\/replase2-1.png\" alt=\"\" class=\"wp-image-6936\"\/><\/figure>\n\n\n\n<p>\u5168\u3066\u306e URL\u3092\u65b0\u3057\u3044 URL \u306b\u7f6e\u63db\u3057\u307e\u3059\u3002\u6587\u5b57\u5217\u304c\u5168\u3066\u7f6e\u63db\u3055\u308c\u305f\u3089\u3001\u65b0\u3057\u3044\u30d5\u30a1\u30a4\u30eb\u540d mput1.sql \u306f mpst.sql\u306b\u5909\u66f4\u3057\u307e\u3059\u3002\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u30c6\u30b9\u30c8\u30b5\u30fc\u30d0\u30fc\u306b\u8ee2\u9001\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">DB\u306b mpst.sql \u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3057\u307e\u3059<\/h3>\n\n\n\n<p class=\"has-background\" style=\"background-color:#444444\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-white-color\">\u7de8\u96c6PC\u3067\u306e scp \u30b3\u30de\u30f3\u30c9\u64cd\u4f5c\n$ <\/mark><mark style=\"background-color:rgba(0, 0, 0, 0);color:#ffff00\" class=\"has-inline-color\">scp .\/mpst.sql root@192.168.12.203:\/home\/<\/mark><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-white-color\">\n\n\u30c6\u30b9\u30c8\u30b5\u30fc\u30d0\u30fc\u3067\u306e\u64cd\u4f5c\n# <\/mark><mark style=\"background-color:rgba(0, 0, 0, 0);color:#ffff00\" class=\"has-inline-color\">cd \/home\/<\/mark><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-white-color\">\n# <\/mark><mark style=\"background-color:rgba(0, 0, 0, 0);color:#ffff00\" class=\"has-inline-color\">mysql -u root -p<\/mark><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-white-color\">\nEnter password\u3000\u3000\u3000\u3000\u3000\uff1c\uff1d\uff1d\uff1dDB\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5165\u529b\nmysql &gt; <\/mark><mark style=\"background-color:rgba(0, 0, 0, 0);color:#ffff00\" class=\"has-inline-color\">show databases;<\/mark><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-white-color\">\n+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+\n| Database           |\n+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+\n| information_schema |\n| mput1              |\n| mput2              |\n| mysql              |\n| performance_schema |\n| sys                |\n+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+\n6 rows in set (0.00 sec)\n\nmysql &gt; <\/mark><mark style=\"background-color:rgba(0, 0, 0, 0);color:#ffff00\" class=\"has-inline-color\">create database mpst;<\/mark><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-white-color\">\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql &gt; <\/mark><mark style=\"background-color:rgba(0, 0, 0, 0);color:#ffff00\" class=\"has-inline-color\">quit;<\/mark><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-white-color\">\nBye\n# <\/mark><mark style=\"background-color:rgba(0, 0, 0, 0);color:#ffff00\" class=\"has-inline-color\">mysql -u root -p mpst &lt; mpst.sql<\/mark><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-white-color\">\nEnter password:        &lt;=== \u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5165\u529b\u3057Enter\u3092\u62bc\u3057\u307e\u3059\n#<\/mark><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">WordPress\u30d5\u30a1\u30a4\u30eb\u3092\u30b3\u30d4\u30fc\u3057\u307e\u3059<\/h3>\n\n\n\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308bWordPress\u30d5\u30a1\u30a4\u30eb\u306f[\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u30eb\u30fc\u30c8]\/mput\/\u3067\u3059\u304c\u3001\u3053\u308c\u3092[\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u30eb\u30fc\u30c8]\/mpst\/\u306b\u30b3\u30d4\u30fc\u3057\u307e\u3059<\/p>\n\n\n\n<p class=\"has-background\" style=\"background-color:#444444\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-white-color\"># <\/mark><mark style=\"background-color:rgba(0, 0, 0, 0);color:#ffff00\" class=\"has-inline-color\">cd \/var\/www\/html\/<br><\/mark><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-ast-global-color-5-color\">#<\/mark><mark style=\"background-color:rgba(0, 0, 0, 0);color:#ffff00\" class=\"has-inline-color\"> cp -r -T mput mpst<\/mark><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-white-color\"><br># <\/mark><mark style=\"background-color:rgba(0, 0, 0, 0);color:#ffff00\" class=\"has-inline-color\">ll<\/mark><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-white-color\">\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\uff1c\uff1d\uff1d\uff1d mpst \u30d5\u30a9\u30eb\u30c0\u304c\u6709\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3059<br>drwxr-xr-x.  1 root   root        4096  2\u6708 24 15:59 <\/mark><mark style=\"background-color:rgba(0, 0, 0, 0);color:#00ffff\" class=\"has-inline-color\">mpst<\/mark><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-white-color\"><br>drwxr-xr-x.  5 apache apache      4096  4\u6708  6 13:30 <\/mark><mark style=\"background-color:rgba(0, 0, 0, 0);color:#00ffff\" class=\"has-inline-color\">mput<\/mark><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-white-color\"><br># <\/mark><mark style=\"background-color:rgba(0, 0, 0, 0);color:#ffff00\" class=\"has-inline-color\">chown -R apache:apache mpst<\/mark><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">wp-config.php \u306eDB\u540d\u3092\u5909\u66f4\u3057\u307e\u3059<\/h3>\n\n\n\n<p class=\"has-background\" style=\"background-color:#444444\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-white-color\">wp-config.php\u306bDB\u540d\u304c\u8a18\u8f09\u3055\u308c\u3066\u3044\u307e\u3059\u306e\u3067\u3001\u3053\u308c\u3092\u5909\u66f4\u3057\u307e\u3059<\/mark>\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-white-color\"># <\/mark><mark style=\"background-color:rgba(0, 0, 0, 0);color:#ffff00\" class=\"has-inline-color\">vi wp-config.php<\/mark><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-white-color\"> :set number \u3067\u884c\u756a\u53f7\u3092\u8868\u793a\u3057\u307e\u3059\n     27 \/\/ ** MySQL \u8a2d\u5b9a &#8211; \u3053\u306e\u60c5\u5831\u306f\u30db\u30b9\u30c6\u30a3\u30f3\u30b0\u5148\u304b\u3089\u5165\u624b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 ** \/\/\n     28 \/** WordPress \u306e\u305f\u3081\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u540d *\/\n     29 define(&#8216;DB_NAME&#8217;, &#8216;mpst&#8217;);\u3000\u3000\u3000\u3000\u3000\uff1c\uff1d\uff1d\uff1d &#8216;mput1&#8217; \u3092 &#8216;mpst&#8217; \u306b\u5909\u66f4\n<\/mark><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-yellow-color\">:<\/mark><mark style=\"background-color:rgba(0, 0, 0, 0);color:#ffff00\" class=\"has-inline-color\">wq<\/mark><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-white-color\">\n#<\/mark><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5909\u66f4\u64cd\u4f5c\u304c\u7d42\u308f\u3063\u305f\u3089\u30b5\u30a4\u30c8\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u307f\u308b<\/h2>\n\n\n\n<p>\u30d6\u30e9\u30a6\u30b6\u3067\u3001\u30b3\u30d4\u30fc\u3057\u305f\u30b5\u30a4\u30c8\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u307f\u307e\u3059<br>https:\/\/east19-mikas1.com\/mpst\/<br><br>\u30c6\u30b9\u30c8\u30b5\u30a4\u30c8\u3067\u306f\u6b63\u5e38\u306b\u52d5\u4f5c\u78ba\u8a8d\u304c\u51fa\u6765\u307e\u3057\u305f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3088\u304f\u6709\u308b\u4e8b\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u3001\u4f7f\u7528\u3057\u3066\u3044\u305fDB\u540d\u304c\u91cd\u306a\u308a\u3001\u4e14\u3064\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3082\u540c\u3058\u3060\u3063\u305f\u305f\u3081\u3001\u30c6\u30b9\u30c8\u30b5\u30fc\u30d0\u30fc\u306eDB\u540d\u5909\u66f4\u3068\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u5909\u66f4\u3092\u8a66\u307f\u3066\u307f\u307e\u3057\u305f\u3002 \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u5909\u66f4\u65b9\u6cd5 \u4f7f\u7528\u3057\u3066\u3044\u305f\u30c7\u30fc [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":7892,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[4,16],"tags":[],"class_list":["post-6920","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cms","category-wordpress"],"_links":{"self":[{"href":"https:\/\/east19-mikas.com\/mpat\/index.php?rest_route=\/wp\/v2\/posts\/6920","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/east19-mikas.com\/mpat\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/east19-mikas.com\/mpat\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/east19-mikas.com\/mpat\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/east19-mikas.com\/mpat\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6920"}],"version-history":[{"count":2,"href":"https:\/\/east19-mikas.com\/mpat\/index.php?rest_route=\/wp\/v2\/posts\/6920\/revisions"}],"predecessor-version":[{"id":8058,"href":"https:\/\/east19-mikas.com\/mpat\/index.php?rest_route=\/wp\/v2\/posts\/6920\/revisions\/8058"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/east19-mikas.com\/mpat\/index.php?rest_route=\/wp\/v2\/media\/7892"}],"wp:attachment":[{"href":"https:\/\/east19-mikas.com\/mpat\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6920"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/east19-mikas.com\/mpat\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6920"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/east19-mikas.com\/mpat\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6920"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}