{"id":10672,"date":"2026-11-11T13:59:07","date_gmt":"2026-11-11T04:59:07","guid":{"rendered":"https:\/\/jg7sfr.mydns.jp\/?p=10672"},"modified":"2026-11-11T13:59:08","modified_gmt":"2026-11-11T04:59:08","slug":"%e8%87%aa%e5%ae%85%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc%e3%81%ae%e3%82%bb%e3%82%ad%e3%83%a5%e3%83%aa%e3%83%86%e3%82%a3%e7%82%b9%e6%a4%9c%e3%81%a8-mysql-%e8%a8%ad%e5%ae%9a%e5%bc%b7%e5%8c%96","status":"publish","type":"post","link":"https:\/\/jg7sfr.mydns.jp\/?p=10672","title":{"rendered":"\u81ea\u5b85\u30b5\u30fc\u30d0\u30fc\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u70b9\u691c\u3068 MySQL \u8a2d\u5b9a\u5f37\u5316"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">1. \u5916\u90e8\u3068\u306e\u901a\u4fe1\u72b6\u6cc1\u306e\u78ba\u8a8d<br><br>\u73fe\u5728\u78ba\u7acb\u3057\u3066\u3044\u308b\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u63a5\u7d9a\u3092\u78ba\u8a8d\u3059\u308b\u3002<br># sockstat -46 -c<br>\u3000\u30dd\u30fc\u30c8 <code>22<\/code>\uff08SSH\uff09\uff1a\u81ea\u5206\u306e\u4f5c\u696d\u7528\u7aef\u672b\u304b\u3089\u306e\u63a5\u7d9a\u306e\u307f\u3002<br>\u3000\u30dd\u30fc\u30c8 <code>443<\/code>\uff08HTTPS\uff09\uff1a\u81ea\u5206\u306e\u30d6\u30e9\u30a6\u30b6\u304b\u3089\u306e\u30a2\u30af\u30bb\u30b9\u3068\u3001\u691c\u7d22\u30a8\u30f3\u30b8\u30f3\uff08Bing \u3084 Semrush \u306a\u3069\uff09\u306e\u30af\u30ed\u30fc\u30e9\u30fc\u306e\u307f\u3002\u30b5\u30fc\u30d0\u30fc\u5074\u304b\u3089\u5916\u90e8\u3078\u52dd\u624b\u306b\u901a\u4fe1\u3092\u5f35\u3063\u3066\u3044\u308b\u3088\u3046\u306a\u4e0d\u5be9\u306a\u30d7\u30ed\u30bb\u30b9\u306f\u898b\u5f53\u305f\u3089\u306a\u304b\u3063\u305f\u3002<br><br><br><br>2. \u5f85\u3061\u53d7\u3051\u30dd\u30fc\u30c8\u306e\u78ba\u8a8d\u3068 MySQL \u306e\u8a2d\u5b9a\u5f37\u5316<br><br>\u5916\u90e8\u304b\u3089\u306e\u63a5\u7d9a\u3092\u5f85\u3061\u53d7\u3051\u3066\u3044\u308b\u30b5\u30fc\u30d3\u30b9\u3068\u30dd\u30fc\u30c8\u3092\u78ba\u8a8d\u3059\u308b\u3002<br># sockstat -46 -l<br>\u7a3c\u50cd\u3057\u3066\u3044\u305f\u306e\u306f <code>httpd<\/code>\uff0880, 443\uff09\u3001<code>sshd<\/code>\uff0822\uff09\u3001<code>php-fpm<\/code>\uff08127.0.0.1:9000\uff09\u3001<code>mysqld<\/code>\uff08127.0.0.1:3306, <code>*:33060<\/code>\uff09\u3001<code>ntpd<\/code>\u3001<code>syslogd<\/code>\u3001\u305d\u3057\u3066\u30dd\u30fc\u30c8\u30b9\u30ad\u30e3\u30f3\u691c\u77e5\u7528\u306e <code>portsentry<\/code> \u306e\u307f\u3060\u3063\u305f\u3002\u307b\u3068\u3093\u3069\u304c\u9069\u5207\u306b\u5236\u9650\u3055\u308c\u3066\u3044\u305f\u304c\u3001MySQL \u306e X Protocol \u7528\u30dd\u30fc\u30c8\uff08<code>33060<\/code>\uff09\u3060\u3051\u304c\u5168\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\uff08<code>*:33060<\/code>\uff09\u3067\u5f85\u3061\u53d7\u3051\u3066\u3044\u305f\u305f\u3081\u3001\u5ff5\u306e\u305f\u3081\u30ed\u30fc\u30ab\u30eb\u9650\u5b9a\uff08<code>127.0.0.1<\/code>\uff09\u306b\u7d5e\u308b\u3053\u3068\u306b\u3057\u305f\u3002<br><code>\/usr\/local\/etc\/mysql\/my.cnf<\/code> \u306e <code>[mysqld]<\/code> \u30bb\u30af\u30b7\u30e7\u30f3\uff08<code>bind-address<\/code> \u306e\u4e0b\u306e\u884c\uff09\u306b\u4ee5\u4e0b\u3092\u8ffd\u8a18\u3059\u308b\u3002<br>bind-address                    = 127.0.0.1<br>mysqlx-bind-address             = 127.0.0.1<br><br>\u8a2d\u5b9a\u53cd\u6620\u306e\u305f\u3081 MySQL \u3092\u518d\u8d77\u52d5\u3059\u308b\uff08\u3061\u3087\u3046\u3069 <code>8.4.11<\/code> \u304b\u3089 <code>8.4.13<\/code> \u3078\u306e\u30a2\u30c3\u30d7\u30b0\u30ec\u30fc\u30c9\u5f8c\u306e\u521d\u56de\u8d77\u52d5\u3068\u91cd\u306a\u308a\u3001InnoDB \u306e\u521d\u671f\u5316\u5b8c\u4e86\u307e\u306740\u79d2\u307b\u3069\u304b\u304b\u3063\u305f\uff09\u3002<br># service mysql-server restart<br># sockstat -46 -l | grep mysqld<br>mysql    mysqld     96071 29  tcp4      127.0.0.1:33060       *:*<br>mysql    mysqld     96071 34  tcp4      127.0.0.1:3306        *:*<br>\u3053\u308c\u3067 <code>3306<\/code> \u3068 <code>33060<\/code> \u306e\u4e21\u65b9\u304c <code>127.0.0.1<\/code> \u9650\u5b9a\u306b\u306a\u3063\u305f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><br>3. \u30d7\u30ed\u30bb\u30b9\u8ca0\u8377\u3068 Web \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u66f4\u65b0\u30c1\u30a7\u30c3\u30af<br><br>\u88cf\u3067\u602a\u3057\u3044\u9ad8\u8ca0\u8377\u30d7\u30ed\u30bb\u30b9\u304c\u52d5\u3044\u3066\u3044\u306a\u3044\u304b <code>top<\/code> \u3067\u78ba\u8a8d\u3057\u305f\u3068\u3053\u308d\u3001CPU \u4f7f\u7528\u7387\u306f <code>httpd<\/code> \u3084 <code>mysqld<\/code> \u3082\u542b\u3081\u3066 0.2% \u4ee5\u4e0b\u3068\u975e\u5e38\u306b\u7a4f\u3084\u304b\u3060\u3063\u305f\u3002\u4e0d\u6b63\u30a2\u30af\u30bb\u30b9\u3092\u81ea\u52d5\u906e\u65ad\u3059\u308b <code>blacklistd<\/code> \u3082\u6b63\u5e38\u306b\u7a3c\u50cd\u3057\u3066\u304a\u308a\u3001<code>portsentry<\/code> \u3068\u5408\u308f\u305b\u3066\u4e8c\u91cd\u306e\u9632\u885b\u304c\u3067\u304d\u3066\u3044\u308b\u3002\u307e\u305f\u3001\u76f4\u8fd1 7 \u65e5\u4ee5\u5185\u306b\u4f5c\u6210\u30fb\u5909\u66f4\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u3082\u691c\u7d22\u3057\u305f\u3002<br># find \/usr\/local\/www\/ -mtime -7 -ls<br>\u30d2\u30c3\u30c8\u3057\u305f\u306e\u306f\u3001\u672c\u65e5 <code>apache24-2.4.70<\/code> \u3078\u30a2\u30c3\u30d7\u30b0\u30ec\u30fc\u30c9\u3057\u305f\u969b\u306b\u914d\u7f6e\u3055\u308c\u305f\u6a19\u6e96\u306e\u30a8\u30e9\u30fc\u30da\u30fc\u30b8\u3084\u30a2\u30a4\u30b3\u30f3\u985e\u306e\u307f\u3067\u3001\u4e0d\u5be9\u306a\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u6df7\u5165\u306a\u3069\u306f\u4e00\u5207\u306a\u3057\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. \u5916\u90e8\u3068\u306e\u901a\u4fe1\u72b6\u6cc1\u306e\u78ba\u8a8d \u73fe\u5728\u78ba\u7acb\u3057\u3066\u3044\u308b\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u63a5\u7d9a\u3092\u78ba\u8a8d\u3059\u308b\u3002# sockstat -46 -c\u3000\u30dd\u30fc\u30c8 22\uff08SSH\uff09\uff1a\u81ea\u5206\u306e\u4f5c\u696d\u7528\u7aef\u672b\u304b\u3089\u306e\u63a5\u7d9a\u306e\u307f\u3002\u3000\u30dd\u30fc\u30c8 443\uff08HTTPS\uff09\uff1a\u81ea\u5206\u306e\u30d6\u30e9\u30a6\u30b6\u304b\u3089\u306e\u30a2&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"image","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-10672","post","type-post","status-publish","format-image","hentry","category-bsd","post_format-post-format-image"],"_links":{"self":[{"href":"https:\/\/jg7sfr.mydns.jp\/index.php?rest_route=\/wp\/v2\/posts\/10672","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jg7sfr.mydns.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jg7sfr.mydns.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jg7sfr.mydns.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jg7sfr.mydns.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10672"}],"version-history":[{"count":1,"href":"https:\/\/jg7sfr.mydns.jp\/index.php?rest_route=\/wp\/v2\/posts\/10672\/revisions"}],"predecessor-version":[{"id":10673,"href":"https:\/\/jg7sfr.mydns.jp\/index.php?rest_route=\/wp\/v2\/posts\/10672\/revisions\/10673"}],"wp:attachment":[{"href":"https:\/\/jg7sfr.mydns.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10672"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jg7sfr.mydns.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10672"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jg7sfr.mydns.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10672"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}