标签:记一次mysql启动故障 can't connect to local mysql server through socket '/var/lib/mysql/mysql.sock'
记一次MySQL启动故障 Can‘t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock‘
故障现象:
[root@CentOS ~]# mysql -uroot -p Enter password: ERROR 2002 (HY000): Can‘t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock‘ (2) [root@CentOS ~]# [root@CentOS ~]# service mysqld restart Stopping mysqld: [ OK ] MySQL Daemon failed to start. Starting mysqld: [FAILED] [root@CentOS ~]#
查找MySQL的错误日志在哪里
[root@CentOS ~]# find / -iname ‘*.err‘ /var/lib/mysql/CentOS.err [root@CentOS ~]#
分析错误
[root@CentOS ~]# tail /var/lib/mysql/CentOS.err 170321 09:48:17 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql /usr/libexec/mysqld: error while loading shared libraries: libstdc++.so.6: failed to map segment from shared object: Permission denied 170321 09:48:17 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended [root@CentOS ~]# [root@CentOS ~]# find / -iname ‘*libstdc++.so.6*‘ /usr/lib/libstdc++.so.6 /usr/lib/libstdc++.so.6.0.13 /usr/lib/libstdc++.so.6.0.22 [root@CentOS ~]# [root@CentOS ~]# ll /usr/lib/libstdc++.so.6* lrwxrwxrwx. 1 root root 19 3月 12 10:36 /usr/lib/libstdc++.so.6 -> libstdc++.so.6.0.22 -rwxr-xr-x. 1 root root 942040 11月 21 2013 /usr/lib/libstdc++.so.6.0.13 -rwxr-xr-x. 1 chunli chunli 9099895 3月 12 07:27 /usr/lib/libstdc++.so.6.0.22 [root@CentOS ~]#
搜了一会儿,也没有找到合适的解决方法,倒是看到不少SElinux的身影
尝试关闭SElinux
[root@CentOS ~]# getenforce Enforcing [root@CentOS ~]# setenforce 0 [root@CentOS ~]# getenforce Permissive [root@CentOS ~]# service mysqld restart Stopping mysqld: [ OK ] Starting mysqld: [ OK ]
问题并没有直接解决,而是绕过去了,有时间再啃啃了,先做手头上的事儿。
本文出自 “李春利” 博客,请务必保留此出处http://990487026.blog.51cto.com/10133282/1908657
记一次MySQL启动故障 Can't connect to local MySQL server through socket
标签:记一次mysql启动故障 can't connect to local mysql server through socket '/var/lib/mysql/mysql.sock'
原文地址:http://990487026.blog.51cto.com/10133282/1908657