操作系统为centos,网站突然连接不上数据库,于是朋友直接重启了一下服务器。进到cli模式下,执行 service myqsld start 发现还是提示"mysql deamon failed to start"错误信息。
# /etc/init.d/mysqld start
MySQL Daemon failed to start. Starting mysqld: [FAILED]查看mysqld的log文件
#less /var/log/mysqld.log
141201 11:35:20 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended141201 11:35:43 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql141201 11:35:43 [Warning] '--default-character-set' is deprecated and will be removed in a future release. Please use '--character-set-server' instead.141201 11:35:43 InnoDB: Initializing buffer pool, size = 8.0M141201 11:35:43 InnoDB: Completed initialization of buffer pool141201 11:35:43 InnoDB: Started; log sequence number 0 44233141201 11:35:43 [ERROR] Can't start server: Bind on TCP/IP port: Permission denied141201 11:35:43 [ERROR] Do you already have another mysqld server running on port: 12345 ?141201 11:35:43 [ERROR] Aborting说明应该是SELINUX的权限限制了,需要关掉selinux
查看当前配置信息.
# getenforce
Enforcing
就表明SELinux已经启用.只需要关闭即可。
关闭方法:
/usr/sbin/setenforce 0(0|1 开|关)
或者
setsebool ftpd_disable_trans 1