今天来了公司发现公司内网的web打不开了(周6有人装过系统)
ssh后发现的apache是正常的,mysql的进程也都在。看了下mysql的日志发现报了个很常见的错误 Can't connect to local MySQL server through socket '/tmp/mysql.sock'。 一想这样简单多了。
vim /etc/my.cnf
[client]
#password = your_password
port = 3306
#socket = /tmp/mysql.sock
socket = /var/lib/mysql/mysql.sock
# Here follows entries for some specific programs
# The MySQL server
[mysqld]
port = 3306
#socket = /tmp/mysql.sock
socket =/var/lib/mysql/mysql.sock
skip-locking
key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
修改了socket后重新启动,发现还是无法启动mysql。开始以为权限的问题,仔细看了之后发现也没什么问题,最后看了下分区df -h发现/ 居然满了,清理了一些文件重新启动mysql,这下起来了,顺便做了个链接
ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock
关于mysql.sock
最新推荐文章于 2023-08-16 09:33:38 发布