{"id":798,"date":"2023-05-09T00:05:00","date_gmt":"2023-05-08T15:05:00","guid":{"rendered":"https:\/\/shinke1987.net\/?p=798"},"modified":"2023-05-09T00:06:29","modified_gmt":"2023-05-08T15:06:29","slug":"mariadb%ef%bc%88wordpress%e7%94%a8%ef%bc%89%e3%81%ae%e5%bc%95%e3%81%a3%e8%b6%8a%e3%81%97","status":"publish","type":"post","link":"https:\/\/shinke1987.net\/?p=798","title":{"rendered":"MariaDB\uff08WordPress\u7528\uff09\u306e\u5f15\u3063\u8d8a\u3057"},"content":{"rendered":"\r\n<h2 id=\"toc0\" class=\"wp-block-heading\">\u3084\u308a\u305f\u3044\u3053\u3068<\/h2>\r\n\r\n\r\n\r\n<p>mysqldump\u3092\u5229\u7528\u3057\u3066\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u30fb\u30ea\u30ab\u30d0\u30ea\uff08\u30ea\u30b9\u30c8\u30a2\uff09\u3092\u3059\u308b\u3053\u3068\u3067\u3001<br>WordPress\u7528\u306e\u30c7\u30fc\u30bf\u3092\u79fb\u52d5\u3055\u305b\u308b\u3002<\/p>\r\n\r\n\r\n\r\n<h2 id=\"toc1\" class=\"wp-block-heading\">\u74b0\u5883<\/h2>\r\n\r\n\r\n\r\n<h3 id=\"toc2\" class=\"wp-block-heading\">\u30c7\u30a3\u30b9\u30c8\u30ea\u306b\u3064\u3044\u3066<\/h3>\r\n\r\n\r\n\r\n<p><pre><pre class=\"brush: bash; title: ; notranslate\" title=\"\">$ cat \/etc\/redhat-release<\/pre><\/pre>\r\n<p><br>\u306e\u7d50\u679c\u306f\u6b21\u306e\u901a\u308a\u3002<\/p>\r\n<pre><pre class=\"brush: bash; title: ; notranslate\" title=\"\">Rocky Linux release 9.1 (Blue Onyx)<\/pre><\/pre><\/p>\r\n\r\n\r\n\r\n<h3 id=\"toc3\" class=\"wp-block-heading\">\u5f15\u3063\u8d8a\u3057\u524d\u306e\u74b0\u5883<\/h3>\r\n\r\n\r\n\r\n<figure class=\"wp-block-table\"><table><tbody><tr><td class=\"has-text-align-left\" data-align=\"left\">\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2<\/td><td>\u30d0\u30fc\u30b8\u30e7\u30f3<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\">WordPress<\/td><td>5.1.15<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\">WordPress DB Version<\/td><td>44719<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\">MariaDB<\/td><td>5.5.52-1.el7<\/td><\/tr><\/tbody><\/table><\/figure>\r\n\r\n\r\n\r\n<h3 id=\"toc4\" class=\"wp-block-heading\">\u5f15\u3063\u8d8a\u3057\u5f8c\u306e\u74b0\u5883<\/h3>\r\n\r\n\r\n\r\n<figure class=\"wp-block-table\"><table><tbody><tr><td>\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2<\/td><td>\u30d0\u30fc\u30b8\u30e7\u30f3<\/td><\/tr><tr><td>WordPress<\/td><td>6.2<\/td><\/tr><tr><td>MariaDB<\/td><td>10.5.16-2.el9_0<\/td><\/tr><\/tbody><\/table><\/figure>\r\n\r\n\r\n\r\n<h2 id=\"toc5\" class=\"wp-block-heading\">\u624b\u9806<\/h2>\r\n\r\n\r\n\r\n<h3 id=\"toc6\" class=\"wp-block-heading\">\u30d0\u30c3\u30af\u30a2\u30c3\u30d7<\/h3>\r\n\r\n\r\n\r\n<p>\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u306b\u5229\u7528\u3057\u305f\u30b3\u30de\u30f3\u30c9\u306f\u6b21\u306e\u901a\u308a\u3002<\/p>\r\n<pre><pre class=\"brush: bash; title: ; notranslate\" title=\"\">$ mysqldump -u \u30e6\u30fc\u30b6\u540d -p -A &gt; \u4fdd\u5b58\u5834\u6240\/backup<\/pre><\/pre>\r\n<p>\r\n\r\n\r\n\r\n<\/p>\r\n<h3 id=\"toc7\" class=\"wp-block-heading\">MariaDB\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u521d\u671f\u8a2d\u5b9a<\/h3>\r\n<p>\r\n\r\n\r\n\r\n<\/p>\r\n<p>\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002<\/p>\r\n<pre><pre class=\"brush: bash; title: ; notranslate\" title=\"\"># dnf install mariadb mariadb-server<\/pre><\/pre>\r\n<p>\r\n\r\n\r\n\r\n<\/p>\r\n<p>mariadb-server\u3092\u8d77\u52d5\u3002<\/p>\r\n<pre><pre class=\"brush: bash; title: ; notranslate\" title=\"\"># systemctl start mariadb<\/pre><\/pre>\r\n<p>\r\n\r\n\r\n\r\n<\/p>\r\n<p>\u521d\u671f\u8a2d\u5b9a\u3092\u884c\u3046\u305f\u3081\u306b\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001<\/p>\r\n<pre><pre class=\"brush: bash; title: ; notranslate\" title=\"\"># mysql_secure_installation<\/pre><\/pre>\r\n<p><br \/>\u6b21\u306e\u3088\u3046\u306b\u805e\u304b\u308c\u308b\u3002<\/p>\r\n<pre><pre class=\"brush: bash; title: ; notranslate\" title=\"\">Enter current password for root (enter for none):<\/pre><\/pre>\r\n<p><br \/>MariaDB\u306eroot\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u306f\u307e\u3060\u8a2d\u5b9a\u3057\u3066\u3044\u306a\u3044\u306e\u3067\u3001\u305d\u306e\u307e\u307eEnter\u3092\u62bc\u3059\u3002<\/p>\r\n<pre><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nYou already have your root account protected, so you can safely answer &#039;n&#039;. \r\nSwitch to unix_socket authentication &#x5B;Y\/n]<\/pre><\/pre>\r\n<p><br \/>\u3068\u805e\u304b\u308c\u308b\u3002n\u3092\u62bc\u3057\u3066Enter\u3092\u62bc\u3059\u3002<\/p>\r\n<pre><pre class=\"brush: bash; title: ; notranslate\" title=\"\">You already have your root account protected, so you can safely answer &#039;n&#039;. \r\nChange the root password?<\/pre><\/pre>\r\n<p><br \/>\u3068\u805e\u304b\u308c\u308b\u3002Y\u3092\u62bc\u3057\u3066Enter\u3092\u62bc\u3059\u3068\u8a2d\u5b9a\u3059\u308b\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u805e\u304b\u308c\u308b\u306e\u3067\u5165\u529b\u3059\u308b\u3002<\/p>\r\n<pre><pre class=\"brush: bash; title: ; notranslate\" title=\"\">Remove anonymous users?<\/pre><\/pre>\r\n<p><br \/>\u3068\u805e\u304b\u308c\u308b\u3002Y\u3092\u62bc\u3057\u3066Enter\u3092\u62bc\u3059\u3002<\/p>\r\n<pre><pre class=\"brush: bash; title: ; notranslate\" title=\"\">Disallow root login remotely?<\/pre><\/pre>\r\n<p><br \/>\u3068\u805e\u304b\u308c\u308b\u3002Y\u3092\u62bc\u3057\u3066Enter\u3092\u62bc\u3059\u3002<\/p>\r\n<pre><pre class=\"brush: bash; title: ; notranslate\" title=\"\">Remove test database and access to it?<\/pre><\/pre>\r\n<p><br \/>\u3068\u805e\u304b\u308c\u308b\u3002Y\u3092\u62bc\u3057\u3066Enter\u3092\u62bc\u3059\u3002<\/p>\r\n<pre><pre class=\"brush: bash; title: ; notranslate\" title=\"\">Reload privilege tables now?<\/pre><\/pre>\r\n<p><br \/>\u3068\u805e\u304b\u308c\u308b\u3002Y\u3092\u62bc\u3057\u3066Enter\u3092\u62bc\u3059\u3002<\/p>\r\n<p>\r\n\r\n\r\n\r\n<\/p>\r\n<h3 id=\"toc8\" class=\"wp-block-heading\">WordPress\u306e\u305f\u3081\u306e\u8a2d\u5b9a\u3092MariaDB\u306b\u884c\u3046<\/h3>\r\n<p>\r\n\r\n\r\n\r\n<\/p>\r\n<p>MariaDB\u306b\u30ed\u30b0\u30a4\u30f3\u3059\u308b\u3002<\/p>\r\n<pre><pre class=\"brush: bash; title: ; notranslate\" title=\"\">$ mysql -u root -p<\/pre><\/pre>\r\n<p>\r\n\r\n\r\n\r\n<\/p>\r\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u4e00\u89a7\u8868\u793a\u3002<\/p>\r\n<pre><pre class=\"brush: bash; title: ; notranslate\" title=\"\">&gt; show databases;<\/pre><\/pre>\r\n<p>\r\n\r\n\r\n\r\n<\/p>\r\n<p>DB\u30e6\u30fc\u30b6\u306e\u4e00\u89a7\u8868\u793a\u3002<\/p>\r\n<pre><pre class=\"brush: bash; title: ; notranslate\" title=\"\">&gt; SELECT user, host FROM mysql.user;<\/pre><\/pre>\r\n<p>\r\n\r\n\r\n\r\n<\/p>\r\n<p>WordPress\u7528DB\u30e6\u30fc\u30b6\u3092\u4f5c\u6210\u3059\u308b\u3002<\/p>\r\n<pre><pre class=\"brush: bash; title: ; notranslate\" title=\"\">&gt; CREATE USER \u30e6\u30fc\u30b6\u540d@localhost IDENTIFIED BY &#039;\u30d1\u30b9\u30ef\u30fc\u30c9&#039;;<\/pre><\/pre>\r\n<p>\r\n\r\n\r\n\r\n<\/p>\r\n<p>WordPress\u7528DB\u30e6\u30fc\u30b6\u306e\u6a29\u9650\u3092\u8868\u793a\u3059\u308b\u3002<\/p>\r\n<pre><pre class=\"brush: bash; title: ; notranslate\" title=\"\">&gt; SHOW GRANTS FOR \u30e6\u30fc\u30b6\u540d@localhost;<\/pre><\/pre>\r\n<p>\r\n\r\n\r\n\r\n<\/p>\r\n<p>\u4e0b\u8a18\u306e\u3088\u3046\u306a\u5f62\u3067\u3001\u7d50\u679c\u304c\u8868\u793a\u3055\u308c\u308b\u3002<\/p>\r\n<pre><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n+---------------------------------------------------------------------------------------------------------------+ \r\n| Grants for \u30e6\u30fc\u30b6\u540d@localhost                                                                                   | \r\n+---------------------------------------------------------------------------------------------------------------+ \r\n| GRANT USAGE ON *.* TO `\u30e6\u30fc\u30b6\u540d`@`localhost` IDENTIFIED BY PASSWORD &#039;*F7DC3CA42B9C9E4554D96B433C9FA5625A65F5BF&#039; | \r\n+---------------------------------------------------------------------------------------------------------------+\r\n<\/pre><\/pre>\r\n<p>\r\n\r\n\r\n\r\n<\/p>\r\n<p>WordPress\u7528\u306eDB\u4f5c\u6210\u3002<\/p>\r\n<pre><pre class=\"brush: bash; title: ; notranslate\" title=\"\">&gt; CREATE DATABASE DB\u540d;<\/pre><\/pre>\r\n<p>\r\n\r\n\r\n\r\n<\/p>\r\n<p>\u4f5c\u6210\u3057\u305fWordPress\u7528DB\u30e6\u30fc\u30b6\u306b\u6a29\u9650\u3092\u4e0e\u3048\u308b\u3002<\/p>\r\n<pre><pre class=\"brush: bash; title: ; notranslate\" title=\"\">&gt; GRANT ALL ON DB\u540d.* TO \u30e6\u30fc\u30b6\u540d@localhost;<\/pre><\/pre>\r\n<p>\r\n\r\n\r\n\r\n<\/p>\r\n<p>\u518d\u5ea6\u4f5c\u6210\u3057\u305fWordPress\u7528DB\u30e6\u30fc\u30b6\u306e\u6a29\u9650\u3092\u8868\u793a\u3059\u308b\u3002<\/p>\r\n<pre><pre class=\"brush: bash; title: ; notranslate\" title=\"\">&gt; SHOW GRANTS FOR \u30e6\u30fc\u30b6\u540d@localhost;<\/pre><\/pre>\r\n<p>\r\n\r\n\r\n\r\n<\/p>\r\n<p>\u4e0b\u8a18\u306e\u3088\u3046\u306a\u5f62\u3067\u7d50\u679c\u304c\u8868\u793a\u3055\u308c\u308b\u3002<\/p>\r\n<pre><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n+---------------------------------------------------------------------------------------------------------------+ \r\n| Grants for \u30e6\u30fc\u30b6\u540d@localhost                                                                                   | \r\n+---------------------------------------------------------------------------------------------------------------+ \r\n| GRANT USAGE ON *.* TO `\u30e6\u30fc\u30b6\u540d`@`localhost` IDENTIFIED BY PASSWORD &#039;*F7DC3CA42B9C9E4554D96B433C9FA5625A65F5BF&#039; | \r\n| GRANT ALL PRIVILEGES ON `DB\u540d`.* TO `\u30e6\u30fc\u30b6\u540d`@`localhost`                                             | \r\n+---------------------------------------------------------------------------------------------------------------+\r\n<\/pre><\/pre>\r\n<p>\r\n\r\n\r\n\r\n<\/p>\r\n<p>\u4e0e\u3048\u3089\u308c\u305f\u6a29\u9650\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3059\u308b\u3002<\/p>\r\n<p>\r\n\r\n\r\n\r\n<\/p>\r\n<h3 id=\"toc9\" class=\"wp-block-heading\">\u30ea\u30ab\u30d0\u30ea\u30fb\u30ea\u30b9\u30c8\u30a2<\/h3>\r\n<p>\r\n\r\n\r\n\r\n<\/p>\r\n<p>\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3067\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3057\u3066\u3044\u305f\u30c7\u30fc\u30bf\u3092\u30ea\u30b9\u30c8\u30a2\u3059\u308b\u3002<\/p>\r\n<pre><pre class=\"brush: bash; title: ; notranslate\" title=\"\">$ mysql -h localhost -u \u30e6\u30fc\u30b6\u540d -p\u30d1\u30b9\u30ef\u30fc\u30c9 &lt; \u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u30d5\u30a1\u30a4\u30eb\u540d<\/pre><\/pre>\r\n<p>\r\n\r\n\r\n\r\n<\/p>\r\n<p>\u30ea\u30b9\u30c8\u30a2\u3055\u308c\u305f\u30c7\u30fc\u30bf\u306e\u4e00\u90e8\u3092\u78ba\u8a8d\u3059\u308b\u305f\u3081\u306b\u3001MariaDB\u3078\u30ed\u30b0\u30a4\u30f3\u3002<\/p>\r\n<pre><pre class=\"brush: bash; title: ; notranslate\" title=\"\">$ mysql -u \u30e6\u30fc\u30b6\u540d -p<\/pre><\/pre>\r\n<p>\r\n\r\n\r\n\r\n<\/p>\r\n<p>\u6307\u5b9a\u3057\u305f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3078\u63a5\u7d9a\u3002<\/p>\r\n<pre><pre class=\"brush: bash; title: ; notranslate\" title=\"\">&gt; USE \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u540d;<\/pre><\/pre>\r\n<p>\r\n\r\n\r\n\r\n<\/p>\r\n<p>\u30c6\u30fc\u30d6\u30eb\u4e00\u89a7\u3092\u78ba\u8a8d\u3002<\/p>\r\n<pre><pre class=\"brush: bash; title: ; notranslate\" title=\"\">&gt; SHOW TABLES;<\/pre><\/pre>\r\n<p>\r\n\r\n\r\n\r\n<\/p>\r\n<p>\u6307\u5b9a\u3057\u305f\u30c6\u30fc\u30d6\u30eb\u306e\u30c7\u30fc\u30bf\u3092\u78ba\u8a8d\u3002<\/p>\r\n<pre><pre class=\"brush: bash; title: ; notranslate\" title=\"\">&gt; SELECT * FROM wp_users;<\/pre><\/pre>\r\n<p>\r\n\r\n\r\n\r\n<\/p>\r\n<p>\u7279\u5225\u554f\u984c\u7121\u3051\u308c\u3070\u3053\u308c\u3067DB\u306e\u5f15\u3063\u8d8a\u3057\u306f\u3068\u308a\u3042\u3048\u305a\u5b8c\u4e86\u3002<br>\r\n\u5f8c\u306fwp-content\/uploads\u30d5\u30a9\u30eb\u30c0\u4ee5\u4e0b\u3092\u30b3\u30d4\u30fc\u3059\u308c\u3070\u753b\u50cf\u3082\u554f\u984c\u7121\u304f\u8868\u793a\u3055\u308c\u305f\u3002\r\nDB\u306e\u30c1\u30e5\u30fc\u30cb\u30f3\u30b0\u3082\u3057\u305f\u65b9\u304c\u826f\u3044\u306e\u3060\u308d\u3046\u3051\u3069\u3001\u3068\u308a\u3042\u3048\u305a\u3057\u3070\u3089\u304f\u306f\u5927\u4e08\u592b\u3068\u5224\u65ad\u3059\u308b\u3002<\/p>\r\n<p>\r\n\r\n\r\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>\u3084\u308a\u305f\u3044\u3053\u3068 mysqldump\u3092\u5229\u7528\u3057\u3066\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u30fb\u30ea\u30ab\u30d0\u30ea\uff08\u30ea\u30b9\u30c8\u30a2\uff09\u3092\u3059\u308b\u3053\u3068\u3067\u3001WordPress\u7528\u306e\u30c7\u30fc\u30bf\u3092\u79fb\u52d5\u3055\u305b\u308b\u3002 \u74b0\u5883 \u30c7\u30a3\u30b9\u30c8\u30ea\u306b\u3064\u3044\u3066 $ cat \/etc\/redhat-release \u306e\u7d50\u679c\u306f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[49],"tags":[86,50],"class_list":["post-798","post","type-post","status-publish","format-standard","hentry","category-wordpress","tag-mariadb","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/posts\/798","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/shinke1987.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=798"}],"version-history":[{"count":23,"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/posts\/798\/revisions"}],"predecessor-version":[{"id":821,"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/posts\/798\/revisions\/821"}],"wp:attachment":[{"href":"https:\/\/shinke1987.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=798"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/shinke1987.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=798"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/shinke1987.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=798"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}