質問編集履歴
1
エラーログを確認した結果を追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -27,4 +27,61 @@
|
|
27
27
|
|
28
28
|
|
29
29
|
起動のコードが誤っているのでしょうか・・・?
|
30
|
+
ご教示いただけますと幸いです。
|
31
|
+
|
32
|
+
----------------------------------------
|
33
|
+
【20210107追記】
|
34
|
+
systemctl status mysqld.service、journalctl -xe、logファイルを見てみました。
|
35
|
+
|
36
|
+
■systemctl status mysqld.service の中身
|
37
|
+
```
|
38
|
+
● mysqld.service - MySQL Server
|
39
|
+
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
|
40
|
+
Active: failed (Result: exit-code) since Thu 2021-01-07 15:08:28 UTC; 8s ago
|
41
|
+
Docs: man:mysqld(8)
|
42
|
+
http://dev.mysql.com/doc/refman/en/using-systemd.html
|
43
|
+
Process: 15557 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS (code=exited, status=1/FAILURE)
|
44
|
+
Process: 15493 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
|
45
|
+
Main PID: 15557 (code=exited, status=1/FAILURE)
|
46
|
+
Status: "Server startup in progress"
|
47
|
+
Error: 13 (Permission denied)
|
48
|
+
```
|
49
|
+
パーミッションに問題がとのことでしたので、/var/lib/mysql配下のパーミッションを見てみました。
|
50
|
+
```
|
51
|
+
ec2-user:/var/lib/mysql $ sudo ls -l
|
52
|
+
|
53
|
+
total 32
|
54
|
+
-rw------- 1 mysql mysql 1679 Jan 7 14:45 ca-key.pem
|
55
|
+
-rw-r--r-- 1 mysql mysql 1107 Jan 7 14:45 ca.pem
|
56
|
+
-rw-r--r-- 1 mysql mysql 1107 Jan 7 14:45 client-cert.pem
|
57
|
+
-rw------- 1 mysql mysql 1679 Jan 7 14:45 client-key.pem
|
58
|
+
-rw------- 1 mysql mysql 1679 Jan 7 14:45 private_key.pem
|
59
|
+
-rw-r--r-- 1 mysql mysql 451 Jan 7 14:45 public_key.pem
|
60
|
+
-rw-r--r-- 1 mysql mysql 1107 Jan 7 14:45 server-cert.pem
|
61
|
+
-rw------- 1 mysql mysql 1675 Jan 7 14:45 server-key.pem
|
62
|
+
```
|
63
|
+
↑このようになっております。
|
64
|
+
|
65
|
+
■logファイルを見てみました。
|
66
|
+
```
|
67
|
+
2021-01-07T14:36:41.998101Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.22) initializing of server in progress as process 14011
|
68
|
+
2021-01-07T14:36:41.999868Z 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting.
|
69
|
+
2021-01-07T14:36:41.999896Z 0 [ERROR] [MY-013236] [Server] The designated data directory /var/lib/mysql/ is unusable. You can remove all files that the server added to it.
|
70
|
+
2021-01-07T14:36:41.999964Z 0 [ERROR] [MY-010119] [Server] Aborting
|
71
|
+
2021-01-07T14:36:42.000085Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.22) MySQL Community Server - GPL.
|
72
|
+
2021-01-07T15:08:28.545200Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.22) initializing of server in progress as process 15555
|
73
|
+
2021-01-07T15:08:28.593932Z 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting.
|
74
|
+
2021-01-07T15:08:28.593971Z 0 [ERROR] [MY-013236] [Server] The designated data directory /var/lib/mysql/ is unusable. You can remove all files that the server added to it.
|
75
|
+
2021-01-07T15:08:28.595505Z 0 [ERROR] [MY-010119] [Server] Aborting
|
76
|
+
2021-01-07T15:08:28.610746Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.22) MySQL Community Server - GPL.
|
77
|
+
```
|
78
|
+
↑/var/lib/mysql/の中身を削除しろとあったので、全て削除しましたが、起動を試みるといくつかのファイルができてしまい同じLogの内容が出ます。
|
79
|
+
|
80
|
+
ちなみに、こちらの[http://wordpress.ideacompo.com/?p=13004](http://wordpress.ideacompo.com/?p=13004)が内容的に近いのかなと思いまして、
|
81
|
+
|
82
|
+
```rm -rf /var/lib/mysql```
|
83
|
+
をした後、mysqlをremove⇒再インストールしましたが、同じエラーが出てしまいます。。。
|
84
|
+
|
85
|
+
他に何を試したらよいか分からず困っております・・・
|
86
|
+
|
30
87
|
ご教示いただけますと幸いです。
|