首页 > Linux/Unix, Sql-Mysql > CentOS yum安装mysql后 Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’

CentOS yum安装mysql后 Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’

CentOS Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’

如果仅仅只yum 安装了mysql这个包,启动mysql时就会提示:
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’

yum安装mysql这个包其实是MySQL 客户端程序和共享库,所以我们还需要安装php-mysql和mysql-server这两个包.

[root@localhost ~] yum install mysql mysql-server php-mysql -y
[root@localhost ~] chkconfig mysqld on
[root@localhost ~] service mysqld start
[root@localhost ~] service httpd restart

  1. 匿名 6月 19th, 2012 @ 14:30 | #1

    兄台是怎么找到答案的呢?php-mysql和mysql-server分别是干什么的呢?劳烦告知一下,lvrenkun(at)gmail.com

评论提交中, 请稍候...

留言

可以使用的标签: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>
Trackbacks & Pingbacks ( 0 )
  1. 还没有 trackbacks