Mysql启动报错:See "systemctl status mysqld.service" and "journalctl -xe" for details.

在CentOS7 下安装的Mysql启动时报错,提示:
Job for mysqld.service failed because the control process exited with error code. See “systemctl status mysqld.service” and “journalctl -xe” for details.


查看日志(/var/log/mysqld.log)

2018-10-03T12:10:44.204033Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.12) starting as process 9067
2018-10-03T12:10:44.212249Z 1 [ERROR] [MY-012271] [InnoDB] InnoDB: The innodb_system data file ‘ibdata1’ must be writable
2018-10-03T12:10:44.212285Z 1 [ERROR] [MY-012278] [InnoDB] InnoDB: The innodb_system data file ‘ibdata1’ must be writable
2018-10-03T12:10:44.212325Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2018-10-03T12:10:44.212416Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2018-10-03T12:10:44.212439Z 0 [ERROR] [MY-010119] [Server] Aborting
2018-10-03T12:10:44.213027Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.12) MySQL Community Server - GPL.


查看文件权限

[[email protected] mysql]# ll
total 155700
-rw-r-----. 1 root root 56 Oct 3 07:52 auto.cnf
-rw-r-----. 1 mysql mysql 0 Oct 3 07:52 binlog.index
-rw-------. 1 root root 1680 Oct 3 07:52 ca-key.pem
-rw-r–r--. 1 root root 1112 Oct 3 07:52 ca.pem

drwxr-x—. 2 root root 28 Oct 3 07:52 sys
-rw-r-----. 1 root root 10485760 Oct 3 07:52 undo_001
-rw-r-----. 1 root root 10485760 Oct 3 07:52 undo_002


修改一下文件的权限:
chown -R mysql ./*

即可正常解决
Mysql启动报错:See "systemctl status mysqld.service" and "journalctl -xe" for details.