源码包,数据存放在/data下,查看错误日志
错误:
[root@kvm3 ~]# service mysqldd start
Starting MySQL. ERROR! The server quit without updating PID file (/data/kvm3.com.pid).
[root@kvm3 ~]# tail /data/kvm3.com.err
2018-09-28T06:59:52.705863Z 0 [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2018-09-28T06:59:52.705866Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.
2018-09-28T06:59:52.705883Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
2018-09-28T06:59:52.705908Z 0 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.7.17-log) starting as process 5071 ...
mysqld: File '/backup/master.index' not found (Errcode: 13 - Permission denied)
2018-09-28T06:59:52.708632Z 0 [ERROR] Aborting
2018-09-28T06:59:52.708644Z 0 [Note] Binlog end
2018-09-28T06:59:52.708700Z 0 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete
发现错误:File ‘/backup/master.index’ not found (Errcode: 13 - Permission denied)
配置文件有问题
[root@kvm3 ~]# cat /etc/my.cnf
[mysqld]
basedir = /usr/local/mysql
datadir = /data
port = 3306
log_bin=/backup/master
server_id = 196
gtid_mode=ON
enforce_gtid_consistency=true
socket = /tmp/mysql.sock
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
解决办法:[root@kvm3 ~]# chmod -R mysql.mysql /backup
[root@kvm3 ~]# service mysqldd start
Starting MySQL. SUCCESS!
配置源码包时:将配置所用到的文件路径的属主和属组都改为mysql。
可能问题二:
[root@kvm4 ~]# service mysqldd start
Starting MySQL… ERROR! The server quit without updating PID file (/data/kvm4.pid).
端口已经被占用:
[root@kvm4 ~]# ss -antp | grep 3306
LISTEN 0 80 :::3306 ::? users:((“mysqld”,pid=3738,fd=16))
[root@kvm4 ~]# killall mysqld
[root@kvm4 ~]# killall mysqld
mysqld: no process found
[root@kvm4 ~]# /etc/init.d/mysqldd start
Starting MySQL. SUCCESS!
[root@kvm1 ~]# service mysqldd start
Starting MySQL... ERROR! The server quit without updating PID file (/data/kvm1.pid).
原因:本机有一个/var/lib/mysql文件里有一个pid,产生冲突,把这个目录删掉