Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.
查看错误日志
vi /var/log/mysqld.log
2019-12-05 11:43:00 45464 [Note] Plugin 'FEDERATED' is disabled.
/usr/sbin/mysqld: Table 'mysql.plugin' doesn't exist
2019-12-05 11:43:00 45464 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
2019-12-05 11:43:00 45464 [Note] InnoDB: Using atomics to ref count buffer pool pages
2019-12-05 11:43:00 45464 [Note] InnoDB: The InnoDB memory heap is disabled
解决办法
1./usr/bin/mysql_install_db --user=mysql
# 报错
FATAL ERROR: Neither host 'localhost.localdomain' nor 'localhost' could be looked up with
/usr/local/mysql/bin/resolveip
Please configure the 'hostname' command to return a correct
hostname.
If you want to solve this at a later stage, restart this script
with the --force option
2. 查看hosts
cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
127.0.0.1 localhost localhost.localdomain localhost6 localhost6.localdomain6
3. 重新/usr/bin/mysql_install_db --user=mysql
还是报错
4.按照第一步提示加上--force
/usr/bin/mysql_install_db --user=mysql --force
成功