mysql连接之ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2
来源:互联网 发布:controlcenter软件下载 编辑:程序博客网 时间:2024/05/19 23:00
连接mysql数据库时出现如下错误:ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)
可能的解决办法
1)确定自己安装的mysql是mysql-server而不是mysql-client。
2)查看mysql-server是否启动(我的问题就是因为没有启动),若没启动则启动mysql-server(启动方式很多详见:http://blog.sina.com.cn/s/blog_4b0e31860100hbjk.html mysql5.6的启动命令方式是:到/usr/local/mysql/support-files目录下执行:mysql.server start)。
3)查看mysql配置文件:
/etc/my.cnf
/etc/mysql/my.cnf
在/etc/my.cnf中和在/etc/mysql/my.cnf中配置的socket文件位置的参数有可能不一致,删除掉/etc/mysql/my.cnf,让mysql以 /etc/my.cnf为准, 即可解决问题。
参考:https://stackoverflow.com/questions/15450091/for-a-newbie-error-2002-hy000-cant-connect-to-local-mysql-server-through-so
https://stackoverflow.com/questions/11657829/error-2002-hy000-cant-connect-to-local-mysql-server-through-socket-var-run
阅读全文
0 0
- mysql连接之ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2
- ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
- ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
- ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
- ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
- ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
- ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
- ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
- ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
- ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
- ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
- ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
- ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
- ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
- Mysql error 2002 (HY000) : Can't connect to local MySQL server through socket '/tmp/mysql.sock'
- mysql error 2002 (HY000) : Can't connect to local MySQL server through socket '/tmp/mysql.sock'
- ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock'
- ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock'
- Google地图API 在网站上嵌入谷歌地图API
- windows 找不到“\\192.168.X.X”,请检查拼写是否正确,然后重试,或单击“开始”,再单机“搜索”,搜索项目。 转至元数据结尾
- 总结一些基本概念
- 解决home键把程序隐藏到后台后,再次点击应用会重新打开MainActivity问题
- 日語網站大全
- mysql连接之ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2
- 使用jmeter对网站接口进行录制
- 今天做自定义标签时才发现:EVAL_PAPGE、SKIP_PAGE-----我这个菜鸟啊
- DOCKER 从入门到放弃(三)
- 2017中国大学生程序设计竞赛
- <html:select>,<html:option>,<html:options>,<html:optionsCollection>标签使用
- Docker学习笔记 第一记
- IE8-11,bootstrap-datetimepicker,控件有值,但无法通过验证
- 各种路径