一,启动命令
service mysql start
报错:
The server quit without updating PID /var/lib/mysql/develop.portal.bestv.com.cn.pid
二,排障
网上搜了下,方法很多。
没解决还是报错,我们回到根本上排查。-- 查看错误日志
打开mysql配置:
less /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid
打开错误日志:
关键的错误信息
170901 4:56:55 [ERROR] Can't start server: Bind on TCP/IP port: Address already in use
170901 4:56:55 [ERROR] Do you already have another mysqld server running on port: 3306 ?
170901 4:56:55 [ERROR] Aborting
这个是端口占用。
使用端口占用命令查看
lsof -i:3306
看到了两个应用。这两个应用连接这个数据库。
kill掉
再启动mysq,成功。