码迷,mamicode.com
首页 > 数据库 > 详细

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock'

时间:2015-08-15 06:53:21      阅读:160      评论:0      收藏:0      [点我收藏+]

标签:server   service   error   through   local   


报错信息:ERROR 2002 (HY000): Can‘t connect to local MySQL server through socket ‘/tmp/mysql.sock‘ (2)


[root@mysql5 ~]# mysql -uroot -pxxxx

ERROR 2002 (HY000): Can‘t connect to local MySQL server through socket ‘/tmp/mysql.sock‘ (2)

[root@mysql5 ~]# 

[root@mysql5 ~]# 

[root@mysql5 ~]# 

[root@mysql5 ~]# service mysqld3306 restart

 ERROR! MySQL server PID file could not be found!

Starting MySQL. ERROR! The server quit without updating PID file (/data/mysql3306/data/mysql5.5.pid).

[root@mysql5 ~]# 

确定是配置文件有错误,注意查看配置的更改:

[root@mysql5 ~]# 

[root@mysql5 ~]# service mysqld3306 start  

Starting MySQL. ERROR! The server quit without updating PID file (/data/mysql3306/data/mysql5.5.pid).

[root@mysql5 ~]# 

[root@mysql5 ~]# vi /etc/my.cnf

[root@mysql5 ~]# service mysqld3306 start

Starting MySQL.. SUCCESS! 

[root@mysql5 ~]# 

其实我们可以通过查看报错日志来确定是哪里的错误:

-----------------------------------------------------------------------------

150815 03:23:07 mysqld_safe mysqld from pid file /data/mysql3306/data/mysql5.5.pid ended

150815 03:23:16 mysqld_safe Starting mysqld daemon with databases from /data/mysql3306/data

150815  3:23:16 [Note] Plugin ‘FEDERATED‘ is disabled.

150815  3:23:16 [Note] Plugin ‘InnoDB‘ is disabled.

150815  3:23:16 [ERROR] Unknown/unsupported storage engine: InnoDB

150815  3:23:16 [ERROR] Aborting


150815  3:23:16 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete


-----------------------------------------------------------------------------

也可以是其他的报错信息,注意查找error报错信息即可。













本文出自 “MySQL_db” 博客,请务必保留此出处http://mysqldb.blog.51cto.com/10264653/1684765

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock'

标签:server   service   error   through   local   

原文地址:http://mysqldb.blog.51cto.com/10264653/1684765

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!