質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
CentOS

CentOSは、主にRed Hat Enterprise Linux(RHEL)をベースにした、フリーのソフトウェアオペレーティングシステムです。

MySQL

MySQL(マイエスキューエル)は、TCX DataKonsultAB社などが開発するRDBMS(リレーショナルデータベースの管理システム)です。世界で最も人気の高いシステムで、オープンソースで開発されています。MySQLデータベースサーバは、高速性と信頼性があり、Linux、UNIX、Windowsなどの複数のプラットフォームで動作することができます。

Linux

Linuxは、Unixをベースにして開発されたオペレーティングシステムです。日本では「リナックス」と呼ばれています。 主にWebサーバやDNSサーバ、イントラネットなどのサーバ用OSとして利用されています。 上位500のスーパーコンピュータの90%以上はLinuxを使用しています。 携帯端末用のプラットフォームAndroidは、Linuxカーネル上に構築されています。

MariaDB

MariaDBは、MySQL派生のオープンソースなリレーショナルデータベースシステムです。 また、MySQLとほぼ同じデータベースエンジンに対応しています。

AWS(Amazon Web Services)

Amazon Web Services (AWS)は、仮想空間を機軸とした、クラスター状のコンピュータ・ネットワーク・データベース・ストーレッジ・サポートツールをAWSというインフラから提供する商用サービスです。

Q&A

解決済

1回答

2624閲覧

AWSのCentOS7でMysql8.0が起動できない

0tuy0r0hi

総合スコア13

CentOS

CentOSは、主にRed Hat Enterprise Linux(RHEL)をベースにした、フリーのソフトウェアオペレーティングシステムです。

MySQL

MySQL(マイエスキューエル)は、TCX DataKonsultAB社などが開発するRDBMS(リレーショナルデータベースの管理システム)です。世界で最も人気の高いシステムで、オープンソースで開発されています。MySQLデータベースサーバは、高速性と信頼性があり、Linux、UNIX、Windowsなどの複数のプラットフォームで動作することができます。

Linux

Linuxは、Unixをベースにして開発されたオペレーティングシステムです。日本では「リナックス」と呼ばれています。 主にWebサーバやDNSサーバ、イントラネットなどのサーバ用OSとして利用されています。 上位500のスーパーコンピュータの90%以上はLinuxを使用しています。 携帯端末用のプラットフォームAndroidは、Linuxカーネル上に構築されています。

MariaDB

MariaDBは、MySQL派生のオープンソースなリレーショナルデータベースシステムです。 また、MySQLとほぼ同じデータベースエンジンに対応しています。

AWS(Amazon Web Services)

Amazon Web Services (AWS)は、仮想空間を機軸とした、クラスター状のコンピュータ・ネットワーク・データベース・ストーレッジ・サポートツールをAWSというインフラから提供する商用サービスです。

0グッド

1クリップ

投稿2019/07/23 02:05

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を動かす

LAMP+Wordpress+Python(Django)のセットアップメモ2019

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

TaichiYanagiya

2019/07/23 13:14

/var/log/mysqld.log に何かエラーが出力されていないでしょうか?
0tuy0r0hi

2019/07/23 13:35

ご回答頂きありがとうございます。 回答で頂いていた箇所のログです。 $ sudo grep "ERROR" /var/log/mysqld.log 2019-07-23T00:55:27.943175-00:00 0 [ERROR] [MY-012681] [InnoDB] mmap(137363456 bytes) failed; errno 12 2019-07-23T00:55:27.943239-00:00 1 [ERROR] [MY-012956] [InnoDB] Cannot allocate memory for the buffer pool 2019-07-23T00:55:27.943261-00:00 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error. 2019-07-23T00:55:27.948306-00:00 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine 2019-07-23T00:55:27.948425-00:00 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed. 2019-07-23T00:55:27.948565-00:00 0 [ERROR] [MY-010119] [Server] Aborting 2019-07-23T01:04:15.566548-00:00 0 [ERROR] [MY-012681] [InnoDB] mmap(137363456 bytes) failed; errno 12 2019-07-23T01:04:15.566741-00:00 1 [ERROR] [MY-012956] [InnoDB] Cannot allocate memory for the buffer pool 2019-07-23T01:04:15.566763-00:00 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error. 2019-07-23T01:04:15.566784-00:00 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine 2019-07-23T01:04:15.566886-00:00 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed. 2019-07-23T01:04:15.567696-00:00 0 [ERROR] [MY-010119] [Server] Aborting 2019-07-23T01:05:11.652115-00:00 0 [ERROR] [MY-012681] [InnoDB] mmap(137363456 bytes) failed; errno 12 2019-07-23T01:05:11.652163-00:00 1 [ERROR] [MY-012956] [InnoDB] Cannot allocate memory for the buffer pool 2019-07-23T01:05:11.652202-00:00 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error. 2019-07-23T01:05:11.652227-00:00 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine 2019-07-23T01:05:11.652330-00:00 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed. 2019-07-23T01:05:11.656771-00:00 0 [ERROR] [MY-010119] [Server] Aborting 2019-07-23T01:07:10.822756-00:00 0 [ERROR] [MY-012681] [InnoDB] mmap(137363456 bytes) failed; errno 12 2019-07-23T01:07:10.822805-00:00 1 [ERROR] [MY-012956] [InnoDB] Cannot allocate memory for the buffer pool 2019-07-23T01:07:10.822838-00:00 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error. 2019-07-23T01:07:10.822875-00:00 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine 2019-07-23T01:07:10.823002-00:00 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed. 2019-07-23T01:07:10.823139-00:00 0 [ERROR] [MY-010119] [Server] Aborting 2019-07-23T01:10:12.934808-00:00 0 [ERROR] [MY-012681] [InnoDB] mmap(137363456 bytes) failed; errno 12 2019-07-23T01:10:12.935463-00:00 1 [ERROR] [MY-012956] [InnoDB] Cannot allocate memory for the buffer pool 2019-07-23T01:10:12.935494-00:00 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error. 2019-07-23T01:10:12.935522-00:00 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine 2019-07-23T01:10:12.935658-00:00 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed. 2019-07-23T01:10:12.935816-00:00 0 [ERROR] [MY-010119] [Server] Aborting 2019-07-23T01:12:32.527319-00:00 0 [ERROR] [MY-012681] [InnoDB] mmap(137363456 bytes) failed; errno 12 2019-07-23T01:12:32.527378-00:00 1 [ERROR] [MY-012956] [InnoDB] Cannot allocate memory for the buffer pool 2019-07-23T01:12:32.527402-00:00 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error. 2019-07-23T01:12:32.527424-00:00 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine 2019-07-23T01:12:32.527510-00:00 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed. 2019-07-23T01:12:32.532777-00:00 0 [ERROR] [MY-010119] [Server] Aborting 2019-07-23T01:39:29.795973-00:00 0 [ERROR] [MY-012681] [InnoDB] mmap(137363456 bytes) failed; errno 12 2019-07-23T01:39:29.796027-00:00 1 [ERROR] [MY-012956] [InnoDB] Cannot allocate memory for the buffer pool 2019-07-23T01:39:29.796051-00:00 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error. 2019-07-23T01:39:29.796074-00:00 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine 2019-07-23T01:39:29.796159-00:00 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed. 2019-07-23T01:39:29.796337-00:00 0 [ERROR] [MY-010119] [Server] Aborting
guest

回答1

0

ベストアンサー

メモリ不足のようです。
swap ファイルを追加するか、よりメモリの多い仮想マシンを使うといいと思います。

投稿2019/07/23 14:18

TaichiYanagiya

総合スコア12146

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

0tuy0r0hi

2019/07/24 11:18

確かに一番安い512MBを選択しました。 アドバイスの通りswapファイルを作成したところ無事に起動しました! 本当にありがとうございました。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問