擅长:python、mysql、java
<p>您的mysql安装可能会将套接字放在其他地方。您可以在mysql conf文件中对此进行配置。</p>
<p>你可能想看看这个类似的帖子:<a href="https://stackoverflow.com/questions/1136808/installing-mysql-on-leopard-cant-connect-to-local-mysql-server-through-socket">Installing mysql on leopard: "Can't connect to local MySQL server through socket"</a></p>