该报错需要结合mysqlerr日志看,err日志目录在mysql的my.cnf文件中查找。
通过查看日志报错
2022-02-11T06:46:13.661051Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
2022-02-11T06:46:13.661154Z 0 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.7.36-log) starting as process 29662 ...
mysqld: File '/data/mysql/data/log/mysql-bin.index' not found (Errcode: 13 - Permission denied)
2022-02-11T06:46:13.665048Z 0 [ERROR] Aborting
发现是没有创建配置binlog文件,创建好改文件后,还需要赋予权限。chown mysql:mysql -R /data/mysql