您的位置主页 > MYSQL

实例讲解启动mysql server失败的解决方法

启动mysql server 失败,查看/var/log/mysqld.err
080329 16:01:29 [ERROR] Can't start server : Bind on unix socket: No such file or directory
080329 16:01:29 [ERROR] Do you already have another mysqld server running on socket: /var/run/mysqld/mysqld.sock ?
080329 16:01:29 [ERROR] Aborting
080329 16:01:29 InnoDB: Starting shutdown...
080329 16:01:30 InnoDB: Shutdown completed; log sequence number 0 4646872
080329 16:01:30 [Note] /usr/sbin/mysqld: Shutdown complete
百思不得其解,后来查看/var/db/pkg/dev-db/mysql-5.0.56/CONTENTS 文件,或者执行equery f mysql(两种方法非Gentoo Linux 发布不适用),得知安装文件中包含/var/run/mysqld,而这个目录不存在,回忆起之前曾清空过/var/run目录,一直以为这下面的内容都是动态创建,删除之后重启系统即可,看来对mysql 来说还不是这么回事。
创建此目录,并chown,问题解决。
# mkdir /var/run/mysqld
# chown mysql:mysql /var/run/mysqld