ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/data/3310/mysql.sock'
时间: 2023-09-11 20:06:42 浏览: 109
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/data/3310/mysql.sock'这个错误消息表明MySQL无法通过'/data/3310/mysql.sock'这个套接字文件连接到本地MySQL服务器。 套接字文件是用于在同一台计算机上的进程之间进行通信的一种机制。对于MySQL来说,套接字文件用于本地连接,即通过UNIX域套接字进行连接。 您可以通过检查'/data/3310/mysql.sock'文件是否存在来验证该文件是否存在。您可以使用命令'ls /data/3310'来检查该文件是否存在。如果文件不存在,您可以使用命令'sudo mkdir /data/3310'创建目录,然后使用命令'sudo touch /data/3310/mysql.sock'创建套接字文件。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [Mysql出现问题:ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/data/mysql...](https://blog.csdn.net/shi_hong_fei_hei/article/details/129912641)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* [ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock'](https://download.csdn.net/download/weixin_38590775/12823462)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文