{"id":8483,"date":"2020-08-13T18:48:06","date_gmt":"2020-08-13T09:48:06","guid":{"rendered":"https:\/\/www.gesource.jp\/weblog\/?p=8483"},"modified":"2020-08-13T18:48:06","modified_gmt":"2020-08-13T09:48:06","slug":"mysql%e3%81%a7%e3%82%a8%e3%83%a9%e3%83%bc%e3%80%8ccant-connect-to-local-mysql-server-through-socket-var-lib-mysql-mysql-sock-111%e3%80%8d","status":"publish","type":"post","link":"https:\/\/www.gesource.jp\/weblog\/?p=8483","title":{"rendered":"MySQL\u3067\u30a8\u30e9\u30fc\u300cCan&#8217;t connect to local MySQL server through socket &#8216;\/var\/lib\/mysql\/mysql.sock&#8217; (111)\u300d"},"content":{"rendered":"<p>MySQL\u306b\u63a5\u7d9a\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u3066\u3001\u63a5\u7d9a\u3067\u304d\u306a\u3044\u3002<\/p>\n<blockquote><p>\n  Can&#8217;t connect to local MySQL server through socket &#8216;\/var\/lib\/mysql\/mysql.sock&#8217; (111)\n<\/p><\/blockquote>\n<p>MySQL\u306e\u30b9\u30c6\u30fc\u30bf\u30b9\u3092\u78ba\u8a8d\u3059\u308b<\/p>\n<pre><code>$ systemctl status mysqld\n<\/code><\/pre>\n<p>\u30b5\u30fc\u30d3\u30b9\u306e\u8d77\u52d5\u306b\u5931\u6557\u3057\u3066\u3044\u305f\u3053\u3068\u304c\u308f\u304b\u3063\u305f<\/p>\n<p>\u30ed\u30b0\u3092\u78ba\u8a8d\u3059\u308b<\/p>\n<pre><code>$ sudo less \/var\/log\/mysqld.log\n<\/code><\/pre>\n<p>\u30a8\u30e9\u30fc\u304c\u51fa\u3066\u3044\u305f<\/p>\n<blockquote><p>\n  [ERROR] InnoDB: Tablespace 3188923 was not found at .\/XXX\/XXXX.ibd.<br \/>\n  [ERROR] InnoDB: Set innodb_force_recovery=1 to ignore this and to permanently lose all changes to the tablespace.<br \/>\n  [ERROR] InnoDB: Cannot continue operation.\n<\/p><\/blockquote>\n<p>my.cnf\u3092\u7de8\u96c6\u3059\u308b<\/p>\n<pre><code>$ sudo vi \/etc\/my.cnf\n<\/code><\/pre>\n<p>\u300cinnodb_force_recovery=1\u300d\u3092\u8ffd\u52a0\u3059\u308b<\/p>\n<pre><code>[mysqld]\ninnodb_force_recovery=1\n<\/code><\/pre>\n<p>MySQL\u3092\u8d77\u52d5\u3059\u308b<\/p>\n<pre><code>$ sudo systemctl start mysqld\n<\/code><\/pre>\n<p>\u8d77\u52d5\u3067\u304d\u305f\u3053\u3068\u3092\u78ba\u8a8d\u3059\u308b<\/p>\n<pre><code>$ systemctl status mysqld\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>MySQL\u306b\u63a5\u7d9a\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u3066\u3001\u63a5\u7d9a\u3067\u304d\u306a\u3044\u3002 Can&#8217;t connect to local MySQL server through socket &#8216;\/var\/li &#8230;<\/p>\n<p><a href=\"https:\/\/www.gesource.jp\/weblog\/?p=8483\" class=\"more-link\">Continue reading &lsquo;MySQL\u3067\u30a8\u30e9\u30fc\u300cCan&#8217;t connect to local MySQL server through socket &#8216;\/var\/lib\/mysql\/mysql.sock&#8217; (111)\u300d&rsquo; &raquo;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[24],"tags":[187],"class_list":["post-8483","post","type-post","status-publish","format-standard","hentry","category-programming","tag-mysql"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.gesource.jp\/weblog\/index.php?rest_route=\/wp\/v2\/posts\/8483","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gesource.jp\/weblog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gesource.jp\/weblog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gesource.jp\/weblog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gesource.jp\/weblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8483"}],"version-history":[{"count":0,"href":"https:\/\/www.gesource.jp\/weblog\/index.php?rest_route=\/wp\/v2\/posts\/8483\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.gesource.jp\/weblog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8483"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gesource.jp\/weblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8483"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gesource.jp\/weblog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8483"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}