记一次MySQL启动故障 Can't connect to local MySQL server through socket
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了记一次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‘
故障现象:
[[email protected] ~]# mysql -uroot -p Enter password: ERROR 2002 (HY000): Can‘t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock‘ (2) [[email protected] ~]# [[email protected] ~]# service mysqld restart Stopping mysqld: [ OK ] MySQL Daemon failed to start. Starting mysqld: [FAILED] [[email protected] ~]#
查找MySQL的错误日志在哪里
[[email protected] ~]# find / -iname ‘*.err‘ /var/lib/mysql/CentOS.err [[email protected] ~]#
分析错误
[[email protected] ~]# 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 [[email protected] ~]# [[email protected] ~]# find / -iname ‘*libstdc++.so.6*‘ /usr/lib/libstdc++.so.6 /usr/lib/libstdc++.so.6.0.13 /usr/lib/libstdc++.so.6.0.22 [[email protected] ~]# [[email protected] ~]# 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 [[email protected] ~]#
搜了一会儿,也没有找到合适的解决方法,倒是看到不少SElinux的身影
尝试关闭SElinux
[[email protected] ~]# getenforce Enforcing [[email protected] ~]# setenforce 0 [[email protected] ~]# getenforce Permissive [[email protected] ~]# 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的主要内容,如果未能解决你的问题,请参考以下文章
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock'
在启动MYSQL时出现问题:“ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)”