运行最低版本的 Centos 6.0 作为 vagrant box,SELINUX=permissive。立即执行“yum install mysql-server”,然后执行“service mysqld start”,失败。
在 /var/log/mysql.log 中我们有以下内容--
130815 10:47:32 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
130815 10:47:32 [Warning] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive
130815 10:47:32 InnoDB: Initializing buffer pool, size = 8.0M
130815 10:47:32 InnoDB: Completed initialization of buffer pool
130815 10:47:32 InnoDB: Started; log sequence number 0 44233
130815 10:47:32 [ERROR] Can't start server : Bind on unix socket: Operation not permitted
130815 10:47:32 [ERROR] Do you already have another mysqld server running on socket: /var/lib/mysql/mysql.sock ?
130815 10:47:32 [ERROR] Aborting
130815 10:47:32 InnoDB: Starting shutdown...
130815 10:47:38 InnoDB: Shutdown completed; log sequence number 0 44233
130815 10:47:38 [Note] /usr/libexec/mysqld: Shutdown complete
130815 10:47:38 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
我已经在 Google 上搜索了好多次,但还是很困惑。有人能帮忙吗?
谢谢
答案1
这是由于安装的 /etc/my.cnf 中的配置错误而导致的。它将套接字和 pid 文件放在 /var/lib/mysql 中,而 pid 应该放在 /var/run/mysqld 中,套接字应该放在 /
答案2
您可以使用以下方式检查 mysql 服务器状态
chkconfig mysqld
使用 root 用户启动你的 mysql 服务器。