添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

今天在linux里安装mysql,运行时遇到这样的错误

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'

上网查了下:

这种情况大多数是因为你的mysql是使用rpm方式安装的,它会自动寻找 /var/lib/mysql/mysql.sock 这个文件,
通过unix socket登录mysql。
常见解决办法如下:
1、
创建/修改文件 /etc/my.cnf,至少增加/修改一行
[mysql]
[client]
socket = /tmp/mysql.sock
#在这里写上你的mysql.sock的正确位置,通常不是在 /tmp/ 下就是在 /var/lib/mysql/ 下

2、
指定IP地址,使用tcp方式连接mysql,而不使用本地sock方式
#mysql -h127.0.0.1 -uuser -ppassword

3、
为 mysql.sock 加个连接,比如说实际的mysql.sock在 /tmp/ 下,则
#ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock即可

我用的是3来解决的,由于对linux还不太了解,记下来方便查阅



ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'

1.查看一下mysql的状态 systemctl status mariadb 2.启动mysql systemctl start mariadb

ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.s

ps -A | grep -i mysqlkill 列出来的进程service mysql start我的问题就解决了----------------------------------------------Fedora8启动mysql 报错:ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (

[root@Hadoop etc]# /etc/rc.d/init.d/mysqld statusmysqld is stopped[root@Hadoop etc]# find / -name mysql.sock/tmp/mysql.sock

ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (

在linux下,登陆mysql时(mysql -uiis -p),报如下错误:ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2)1、先看一下mysql是否启动 ps -ef | grep mysqld2、确定你的mys

ERROR 2002 (HY000): Can‘t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock‘ (

mysql 报错信息ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)重启mysql解决、systemctl start mysqld.service

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysq

http://hi.baidu.com/magecommerce/item/962c5a329db1eef1a9842809配置文件设置不正确,也可能导致mysql.sock文件无法创建,消除错误日志中的错误!!!今天在linux里安装mysql,运行时遇到这样的错误ERROR 2002 (HY000): Can't connect to local MySQL server through so

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'

原文见:https://blog.csdn.net/lmss82/article/details/4414178/ 今天服务器遇到了一个很熟悉的问题 输入#mysql -u root -p ERROR 20...

ERROR 2002 (HY000): Can‘t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock‘

//ps查看mysqld进程ps -aux|grep mysqld//挨个kill进程sudo kill 进程pid//启动mysql服务service mysql start//成功

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

本机登陆mysql数据库,报以下错误:# mysql -u root -p Enter password: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.soc...

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)

[root@gaosheng ~]# mysql -uarcerzhang -parcerzhang -hlocalhostERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/m...

随着智能手机和移动互联网的快速发展,现在大家和手机的关系是越来越亲密了。这不,现在不管什么事儿,大家都喜欢记在手机里。当然了,大家之所以选择在手机上记东西,图的主要还是方便、快捷!既然这样的话,那么手机上有什么可以快速记录的备忘录便签app吗? 随着智能手机和移动互联网的快速发展,现在大家和手机的关系是越来越亲密了。这不,现在不管什么事儿,大家都喜欢记在

spring boot 微信分享 基于springboot的微信小程序

微信小程序申请小程序账号引入依赖yml配置读取配置文件类WxMaProperties配置文件加载json返回工具类控制层前端代码-小程序项目哦,hubild直接创建界面效果图以上就完成了哦,简单教程 申请小程序账号注册小程序点我引入依赖<!-- 小程序依赖 --> <dependency> <groupId>com.github.binarywang&

Android 语言包位置 安卓语言代码

public static String getSysLanguage() { Locale locale = Locale.getDefault(); String lang = locale.getLanguage(); Log.w("getSysLanguage",lang); return lang;