{"id":986,"date":"2013-10-17T20:40:03","date_gmt":"2013-10-17T20:40:03","guid":{"rendered":"http:\/\/www.omniweb.com\/wordpress\/?p=986"},"modified":"2013-10-19T10:14:07","modified_gmt":"2013-10-19T10:14:07","slug":"cant-connect-to-local-mysql-server-through-socket","status":"publish","type":"post","link":"https:\/\/www.omniweb.com\/wordpress\/?p=986","title":{"rendered":"Can&#8217;t connect to local MySQL server through socket"},"content":{"rendered":"<p>on a mysql server while trying to connect from command line, i just get:<br \/>\nERROR 2002 (HY000): Can&#8217;t connect to local MySQL server through socket &#8216;\/var\/run\/mysqld\/mysqld.sock&#8217; (2)<\/p>\n<p>I see that mysql is creating the socket in \/var\/lib\/mysql\/mysql.sock<br \/>\nSo to correct the problem, I created a symlink from the actual socket to where mysql command is looking;<br \/>\n<code>mkdir \/var\/run\/mysqld<br \/>\ncd \/var\/run\/mysqld<br \/>\nln -s \/var\/lib\/mysql\/mysql.sock mysqld.sock<\/code><\/p>\n<p>Then mysql connects from command line.  What I&#8217;d like to know is, what tells command line to look for the sock at &#8216;\/var\/run\/mysqld\/mysqld.sock&#8217;, even though my.cnf is specifying &#8216;\/var\/run\/mysql\/mysql.sock&#8217; ?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>on a mysql server while trying to connect from command line, i just get: ERROR 2002 (HY000): Can&#8217;t connect to local MySQL server through socket &#8216;\/var\/run\/mysqld\/mysqld.sock&#8217; (2) I see that mysql is creating the socket in \/var\/lib\/mysql\/mysql.sock So to correct &hellip; <a href=\"https:\/\/www.omniweb.com\/wordpress\/?p=986\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/986"}],"collection":[{"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=986"}],"version-history":[{"count":4,"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/986\/revisions"}],"predecessor-version":[{"id":992,"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/986\/revisions\/992"}],"wp:attachment":[{"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=986"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=986"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=986"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}