AWSのCentOS7でMysql8.0が起動できない
現在AWSのLightsailでCentos7を借りてWordPress環境の構築を勉強しています。
ApacheやPHP、WordPressは問題なくインストールできたのですが、
今回使おうと思っている、Mysql8.0が起動しなくて困っています。
発生している問題・エラーメッセージ
$ 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.
見ろと言われているであろう箇所
$ systemctl status mysqld.service ● mysqld.service - MySQL Server Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since 火 2019-07-23 01:39:29 UTC; 1min 53s ago Docs: man:mysqld(8) http://dev.mysql.com/doc/refman/en/using-systemd.html Process: 1220 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS (code=exited, status=1/FAILURE) Process: 1193 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS) Main PID: 1220 (code=exited, status=1/FAILURE) Status: "Server startup in progress" Error: 2 (そのようなファイルやディレクトリはありません) 7月 23 01:39:28 ip-172-26-7-200.ap-northeast-1.compute.internal systemd[1]: Starting MySQL Server... 7月 23 01:39:29 ip-172-26-7-200.ap-northeast-1.compute.internal systemd[1]: mysqld.service: main process exited, code=exit...URE 7月 23 01:39:29 ip-172-26-7-200.ap-northeast-1.compute.internal systemd[1]: Failed to start MySQL Server. 7月 23 01:39:29 ip-172-26-7-200.ap-northeast-1.compute.internal systemd[1]: Unit mysqld.service entered failed state. 7月 23 01:39:29 ip-172-26-7-200.ap-northeast-1.compute.internal systemd[1]: mysqld.service failed. Hint: Some lines were ellipsized, use -l to show in full.
$ sudo journalctl -xe -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit systemd-tmpfiles-clean.service has finished starting up. -- -- The start-up result is done. 7月 23 01:20:45 ip-172-26-7-200.ap-northeast-1.compute.internal sudo[1157]: centos : TTY=pts/0 ; PWD=/home/centos ; USER=root ; 7月 23 01:20:45 ip-172-26-7-200.ap-northeast-1.compute.internal sudo[1157]: pam_unix(sudo:session): session opened for user root 7月 23 01:31:11 ip-172-26-7-200.ap-northeast-1.compute.internal sudo[1157]: pam_unix(sudo:session): session closed for user root 7月 23 01:32:34 ip-172-26-7-200.ap-northeast-1.compute.internal dhclient[795]: DHCPREQUEST on eth0 to 172.26.0.1 port 67 (xid=0x6 7月 23 01:32:34 ip-172-26-7-200.ap-northeast-1.compute.internal dhclient[795]: DHCPACK from 172.26.0.1 (xid=0x6aa7fd2b) 7月 23 01:32:37 ip-172-26-7-200.ap-northeast-1.compute.internal dhclient[795]: bound to 172.26.7.200 -- renewal in 1528 seconds. 7月 23 01:39:27 ip-172-26-7-200.ap-northeast-1.compute.internal sudo[1185]: centos : TTY=pts/0 ; PWD=/home/centos ; USER=root ; 7月 23 01:39:27 ip-172-26-7-200.ap-northeast-1.compute.internal sudo[1185]: pam_unix(sudo:session): session opened for user root 7月 23 01:39:28 ip-172-26-7-200.ap-northeast-1.compute.internal polkitd[511]: Registered Authentication Agent for unix-process:11 7月 23 01:39:28 ip-172-26-7-200.ap-northeast-1.compute.internal systemd[1]: Starting MySQL Server... -- Subject: Unit mysqld.service has begun start-up -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit mysqld.service has begun starting up. 7月 23 01:39:29 ip-172-26-7-200.ap-northeast-1.compute.internal systemd[1]: mysqld.service: main process exited, code=exited, sta 7月 23 01:39:29 ip-172-26-7-200.ap-northeast-1.compute.internal systemd[1]: Failed to start MySQL Server. -- Subject: Unit mysqld.service has failed -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit mysqld.service has failed. -- -- The result is failed. 7月 23 01:39:29 ip-172-26-7-200.ap-northeast-1.compute.internal systemd[1]: Unit mysqld.service entered failed state. 7月 23 01:39:29 ip-172-26-7-200.ap-northeast-1.compute.internal systemd[1]: mysqld.service failed. 7月 23 01:39:29 ip-172-26-7-200.ap-northeast-1.compute.internal polkitd[511]: Unregistered Authentication Agent for unix-process: 7月 23 01:39:29 ip-172-26-7-200.ap-northeast-1.compute.internal sudo[1185]: pam_unix(sudo:session): session closed for user root 7月 23 01:41:46 ip-172-26-7-200.ap-northeast-1.compute.internal sshd[1229]: Received disconnect from 118.194.132.112 port 41975:1 7月 23 01:41:46 ip-172-26-7-200.ap-northeast-1.compute.internal sshd[1229]: Disconnected from 118.194.132.112 port 41975 [preauth 7月 23 01:46:32 ip-172-26-7-200.ap-northeast-1.compute.internal sudo[1241]: centos : TTY=pts/0 ; PWD=/home/centos ; USER=root ; 7月 23 01:46:32 ip-172-26-7-200.ap-northeast-1.compute.internal sudo[1241]: pam_unix(sudo:session): session opened for user root lines 1867-1903/1903 (END)
試したこと
AWSのCentOS7にはデフォルトでMariaDBがインストールされているようなので
以下コマンドでMariaDBアンインストール後にMysql8.0をインストールしました。
MariaDBがあるか確認 $ rpm -qa | grep maria MariaDBの削除 $ sudo yum -y remove mariadb-libs ディレクトリの消去 $ sudo rm -rf /var/lib/mysql
補足情報
以下流れでMysql8.0をインストールしています。
Mysqlインストールに必要なリポジトリのダウンロード sudo rpm -ivh https://dev.mysql.com/get/mysql80-community-release-el7-2.noarch.rpm Mysqlのインストール sudo yum -y install mysql-community-devel mysql-community-server Mysqlの設定変更 sudo vim /etc/my.cnf 最下部に以下を追記 log_timestamps=SYSTEM skip-character-set-client-handshake default_authentication_plugin= mysql_native_password
※一応ログを確認するよう努めたつもりなのですが
勉強不足故に原因特定に至れませんでした。
参考にしているサイト
AWS EC2 + CentOS 7.6 + Apache 2.4 + PHP 7.3 + MySQL 8.0 でWordPress5.1を動かす

回答1件
あなたの回答
tips
プレビュー