Home > Database > Mysql Tutorial > body text

找不到mysql.sock的解决方案

WBOY
Release: 2016-06-07 16:51:48
Original
1305 people have browsed it

出现以下的信息:Got an error: Connection error: Can

出现以下的信息:

Got an error: Connection error: Can't connect to local MySQL server through

socket '/var/lib/mysql/mysql.sock'

mysql.sock 突然消失算是常见的问题,如果是第一次安装MySQL后运行时出现,,那只要找出 mysql.sock 在哪里就可以了。

以上的信息表明,mysql.sock应该是在 /var/lib/mysql/ 下 ,如果你找了没找到

就:

#locate mysql.sock

就会出来了,接着你就可以

#mysqladmin -S /路径/mysql.sock -u root

如果原来很正常的,突然有一天系统告诉你找不到mysql.sock这鬼文件了,怎么办?

那只好用/etc/rc.d/init.d/mysql restart 或者service mysql restart 重启服务了

如果还不行.就先

#ps -aux|grep mysql

找mysql的进程.

#kill mysql进程号

确定全部kill光

再/etc/rc.d/init.d/mysql restart 或者service mysql restart 重启。

linux

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template