MySQL Daemon failed to start.

操作系统为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 ended
141201 11:35:43 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
141201 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.0M
141201 11:35:43  InnoDB: Completed initialization of buffer pool
141201 11:35:43  InnoDB: Started; log sequence number 0 44233
141201 11:35:43 [ERROR] Can't start server: Bind on TCP/IP port: Permission denied
141201 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

 

//以下是修改配置文件重新启动系统的方法

需要修改: vi /etc/selinux/config

SELINUX=disabled

然后重启服务器即可

posted @ 2022-09-23 18:03  silentmuh  阅读(75)  评论(0编辑  收藏  举报
Live2D