#su mysql
$/usr/local/bin/mysql_install_db //重建授权表
$/usr/local/bin/mysqld_safe &
$/usr/local/bin/mysql //测试
mysq>bye;
文件已经解决,重新生成新的 /tmp/mysql.sock 和 hostname.pid
通过这个方案我确实解决了问题;
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//成功
docker启动mysql多实例连接报错Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’
docker启动mysql多实例连接报错Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’
msql报错ERROR 2002 (HY000): Can't connect to local server through socket '/run/mysqld/mysqld.sock' (2)
ERROR 2002 (HY000): Can't connect to local server through socket '/run/mysqld/mysqld.sock' (2)
XtraBackup出现 Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'
解决办法1.建立一个软连接 ln -s /dat/data/mysql/mysql.sock /var/run/mysqld/mysqld.sock 解决办法2:指定--host=127.0.0.1
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
今天服务器遇到了一个很熟悉的问题输入#mysql -u root -pERROR 2002 (HY000):Can't connect to local MySQL server随即上网找寻答案,根据大家提供的方法我逐一尝试:1、先查看 /etc/rc.d/init.d/mysqld status 看看m y s q l 是否已经启动.另外看看是不是权限问题.2、确定你的mysql.sock是不是在那个位置,mysql -u 你的mysql用户名 -p -S /var/lib/mysql/mysql.sock3、试试:service mysqld start4、如果是权限问题,则先改变
mysql出现ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' 错误
神奇。。其他的都没有成功,这个居然成功了!! 还试验过:sudo mysqld restart啥的,都没有用......
mysql之ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'解决方法
LAMPP安装完成之后,mysql -u root -p连不上,报这个错误:ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'在mysql的配置文件里,/opt/lampp/etc/my.cnf, 发现了这样的配置:[java]<SPAN s
记录下mysql在wsl下报错Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)解决办法
mkdir -p /var/run/mysqld chown mysql /var/run/mysqld/ service mysql restart 但貌似这法子有点治标不治本的意思,再研究研究 ...