{"id":229,"date":"2019-04-10T00:29:10","date_gmt":"2019-04-09T15:29:10","guid":{"rendered":"http:\/\/blog.grandaria.com\/?p=229"},"modified":"2019-04-10T00:32:54","modified_gmt":"2019-04-09T15:32:54","slug":"mysql%e3%81%8c%e8%b5%b7%e5%8b%95%e3%81%97%e3%81%aa%e3%81%84%ef%bc%88ubuntu-16-04-3-lts%ef%bc%89","status":"publish","type":"post","link":"https:\/\/blog.grandaria.com\/?p=229","title":{"rendered":"MySQL\u304c\u8d77\u52d5\u3057\u306a\u3044\uff08Ubuntu 16.04.3 LTS\uff09"},"content":{"rendered":"<p>\u4e0b\u8a18\u30a8\u30e9\u30fc\u304c\u3067\u3066\u30c0\u30e1\u3002<\/p>\n<blockquote><p>Could not create unix socket lock file \/var\/run\/mysqld\/mysqld.sock.lock.<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<p>\u3082\u3068\u3082\u3068\u3001Ubuntu 12.04\u3060\u3063\u305f\u306e\u3092\u3001Ubuntu 16.04\u306b\u3042\u3052\u3066\u307f\u305f\u306e\u304c\u904b\u306e\u5c3d\u304d\u3002<\/p>\n<p>\u3042\u3052\u305f\u8a18\u61b6\u306a\u3044\u3093\u3060\u3051\u3069\u306a\u3041\u2026\u2026\u3002<!--more--><\/p>\n<p>&nbsp;<\/p>\n<p>\u2606\u7d50\u8ad6<\/p>\n<p>AppArmor\u304c\u90aa\u9b54\u3057\u3066\u305f\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>12.04\u306e\u3068\u304d\u306a\u3093\u3066\u3001AppArmor\u306a\u304b\u3063\u305f\uff08\u4f7f\u3063\u3066\u306a\u304b\u3063\u305f\uff1f\uff09\u304b\u3089\u6c17\u306b\u3057\u3066\u306a\u304b\u3063\u305f\u3051\u3069\u3001<\/p>\n<p>\u65b0\u3057\u3044Ubuntu\u306f\u6709\u52b9\u306b\u306a\u3063\u3066\u3044\u305f\u306e\u3067\u591a\u5206\u305d\u308c\u304c\u5f71\u97ff\u3057\u3066\u3044\u305f\u306e\u304b\u3068\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u3082\u3068\u3082\u3068\u3001MySQL\u306f\u3001\u30ed\u30c3\u30af\u30d5\u30a1\u30a4\u30eb\u306b\u3001\u300c\/var\/run\/mysqld\/mysqld.sock\u300d\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u3092\u4f7f\u3063\u3066\u3044\u305f\u306e\u306b\u3001<\/p>\n<p>MySQL 5.6.10\u304b\u3089\uff1f\u3042\u305f\u308a\u3067\u3001\u300c\/var\/run\/mysqld\/mysqld.sock.lock\u300d\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u306b\u5909\u308f\u3063\u305f\u3089\u3057\u3044\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u3061\u306a\u307f\u306b\u30a8\u30e9\u30fc\u306f<\/p>\n<p>&nbsp;<\/p>\n<blockquote><p>audit: type=1400 audit(1554822718.426:2598086): apparmor=&#8221;DENIED&#8221; operation=&#8221;open&#8221; profile=&#8221;\/usr\/sbin\/mysqld&#8221; name=&#8221;\/run\/mysqld\/mysqld.sock.lock&#8221; pid=4803 comm=&#8221;mysqld&#8221; requested_mask=&#8221;r&#8221; denied_mask=&#8221;r&#8221; fsuid=102 ouid=102<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<p>\u3053\u3093\u306a\u306e\u3067\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u3067\u3059\u306e\u3067\u3001<\/p>\n<p>\/etc\/apparmor.d\/usr.sbin.mysql\u306e<\/p>\n<p>&nbsp;<\/p>\n<blockquote><p>\/var\/run\/mysqld\/mysqld.pid rw,<br \/>\n\/var\/run\/mysqld\/mysqld.sock w,<br \/>\n\/run\/mysqld\/mysqld.pid rw,<br \/>\n\/run\/mysqld\/mysqld.sock w,<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<p>\u3053\u306e\u3078\u3093\u3092<\/p>\n<p>&nbsp;<\/p>\n<blockquote><p>\/var\/run\/mysqld\/mysqld.pid rw,<br \/>\n\/var\/run\/mysqld\/mysqld.sock w,<br \/>\n\/var\/run\/mysqld\/mysqld.sock.lock rw,<br \/>\n\/run\/mysqld\/mysqld.pid rw,<br \/>\n\/run\/mysqld\/mysqld.sock w,<br \/>\n\/run\/mysqld\/mysqld.sock.lock rw,<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<p>\u3053\u3046\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u3061\u306a\u307f\u306b\u3001w\u3060\u3051\u3064\u3051\u305f\u3089\u3001mknod\u306e\u30a8\u30e9\u30fc\u3058\u3083\u306a\u304f\u3066\u3001open\u306e\u30a8\u30e9\u30fc\u306b\u306a\u3063\u305f\u306e\u3067\u3001r\u3082\u3064\u3051\u307e\u3057\u305f\u3068\u3055\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>\u4fee\u6b63\u3057\u305f\u3089\u4e0b\u8a18\u30b3\u30de\u30f3\u30c9\u5b9f\u884c\u3057\u3066\u518d\u8aad\u8fbc\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>sudo apparmor_parser -r \/etc\/apparmor.d\/usr.sbin.mysqld<\/p>\n<p>&nbsp;<\/p>\n<p><small>\u3044\u3064\u3082sudo\u3064\u3051\u308f\u3059\u308c\u308b\u3093\u3060\u3088\u306a\u3042\u3002<\/small><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>\u3042\u3068\u3001\u591a\u5206\u3001\u4e0b\u8a18\u3082\u3044\u308c\u306a\u3044\u3068\u3060\u3081\u3063\u307d\u3044\u3002\uff08\u591a\u5206r\u3067OK\uff09<\/p>\n<p>&nbsp;<\/p>\n<blockquote><p>\/proc\/* r,<br \/>\n\/sys\/device\/system\/node\/* r,<br \/>\n\/etc\/mysql\/my.cnf.migrated r,<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>\u7d50\u69cb\u96d1\u306b\u3068\u308a\u3042\u3048\u305a\u52d5\u3051\u3070\u3044\u3044\u3084\u3001\u3063\u3066\u611f\u3058\u306a\u306e\u3067\u3001\u96d1\u3067\u3059\u3002<\/p>\n<p>\u5099\u5fd8\u9332\u3068\u3001\u540c\u3058\u3053\u3068\u3067\u60a9\u3093\u3067\u308b\u4eba\u304c\u3044\u308c\u3070\u624b\u52a9\u3051\u306b\u306a\u308c\u3070\u5e78\u3044\u3050\u3089\u3044\u306e\u30e1\u30e2\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e0b\u8a18\u30a8\u30e9\u30fc\u304c\u3067\u3066\u30c0\u30e1\u3002 Could not create unix socket lock file \/var\/run\/mysqld\/mysqld.sock.lock. &nbsp; \u3082\u3068\u3082\u3068\u3001Ubuntu 12.04\u3060 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,22],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.grandaria.com\/index.php?rest_route=\/wp\/v2\/posts\/229"}],"collection":[{"href":"https:\/\/blog.grandaria.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.grandaria.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.grandaria.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.grandaria.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=229"}],"version-history":[{"count":3,"href":"https:\/\/blog.grandaria.com\/index.php?rest_route=\/wp\/v2\/posts\/229\/revisions"}],"predecessor-version":[{"id":232,"href":"https:\/\/blog.grandaria.com\/index.php?rest_route=\/wp\/v2\/posts\/229\/revisions\/232"}],"wp:attachment":[{"href":"https:\/\/blog.grandaria.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=229"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.grandaria.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=229"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.grandaria.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=229"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}