步骤#1:- 删除以前安装的软件包并清除缓存 我已完成步骤#1。
步骤#2:- 设置 Yum 存储库 我完成了步骤#2。
步骤 3:– 禁用 mysql repo 文件中的所有存储库。我执行了步骤 3。
步骤#4 - 安装 MySQL 社区服务器 yum --enablerepo=mysql80-community install mysql-community-server
在步骤#4中我没有收到任何错误。
步骤#5 –导入新的 GPG 密钥 我没有执行步骤#5。
步骤#6 - 重新运行步骤#3 安装 MySQL 社区服务器 我没有执行步骤#6。
步骤#7:测试
ec2-user:~ $ mysql -V mysql Ver 8.0.33 for Linux on x86_64 (MySQL Community Server - GPL)
步骤#8:运行 yum update 时仔细检查没有错误
ec2-user:~ $ sudo sudo yum update Loaded plugins: extras_suggestions, langpacks, update-motd No packages marked for update
ec2-user:~ $ sudo systemctl start mysqld Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details. ec2-user:~ $ sudo systemctl status mysqld ● mysqld.service - MySQL Server Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Tue 2023-06-27 00:09:49 UTC; 12s ago Docs: man:mysqld(8) http://dev.mysql.com/doc/refman/en/using-systemd.html Process: 22229 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS (code=exited, status=1/FAILURE) Process: 22177 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS) Main PID: 22229 (code=exited, status=1/FAILURE) Status: "Server shutdown complete"
Jun 27 00:09:48 ip-172-31-77-158.ec2.internal systemd[1]: Starting MySQL Server... Jun 27 00:09:49 ip-172-31-77-158.ec2.internal systemd[1]: mysqld.service: main process exited, code=exited, status=1/FAILURE Jun 27 00:09:49 ip-172-31-77-158.ec2.internal systemd[1]: Failed to start MySQL Server. Jun 27 00:09:49 ip-172-31-77-158.ec2.internal systemd[1]: Unit mysqld.service entered failed state. Jun 27 00:09:49 ip-172-31-77-158.ec2.internal systemd[1]: mysqld.service failed. ec2-user:~ $ journalctl -xe -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Unit mysqld.service has failed.
-- The result is failed. Jun 27 00:09:49 ip-172-31-77-158.ec2.internal systemd[1]: Unit mysqld.service entered failed state. Jun 27 00:09:49 ip-172-31-77-158.ec2.internal systemd[1]: mysqld.service failed. Jun 27 00:10:01 ip-172-31-77-158.ec2.internal systemd[1]: Started Session 864 of user root. -- Subject: Unit session-864.scope has finished start-up -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Unit session-864.scope has finished starting up.
-- The start-up result is done. Jun 27 00:10:01 ip-172-31-77-158.ec2.internal CROND[22365]: (root) CMD (/home/ec2-user/.c9/stop-if-inactive.sh) Jun 27 00:10:01 ip-172-31-77-158.ec2.internal systemd[1]: Started Session 865 of user root. -- Subject: Unit session-865.scope has finished start-up -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Unit session-865.scope has finished starting up.
-- The start-up result is done. Jun 27 00:10:01 ip-172-31-77-158.ec2.internal CROND[22369]: (root) CMD (/usr/lib64/sa/sa1 1 1) Jun 27 00:10:02 ip-172-31-77-158.ec2.internal sudo[22382]: ec2-user : TTY=pts/2 ; PWD=/home/ec2-user ; USER=root ; COMMAND=/bin/systemctl status mysqld Jun 27 00:10:02 ip-172-31-77-158.ec2.internal sudo[22382]: pam_unix(sudo:session): session opened for user root by (uid=0) Jun 27 00:10:02 ip-172-31-77-158.ec2.internal sudo[22382]: pam_unix(sudo:session): session closed for user root Jun 27 00:10:19 ip-172-31-77-158.ec2.internal dhclient[3843]: XMT: Solicit on eth0, interval 109790ms.
(我差不多已经到达终点线了。)