質問編集履歴
1
サーバーがインストールできていなかった
test
CHANGED
File without changes
|
test
CHANGED
@@ -12,6 +12,52 @@
|
|
12
12
|
|
13
13
|
|
14
14
|
|
15
|
+
### 現状
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
容量が足りておらずサーバーをインストールできていなかったようなので
|
20
|
+
|
21
|
+
容量を追加し、サーバーがインストールできました。
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
```php
|
26
|
+
|
27
|
+
$ sudo yum install mysql-server
|
28
|
+
|
29
|
+
```
|
30
|
+
|
31
|
+
> Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
|
32
|
+
|
33
|
+
amzn2-core | 3.7 kB 00:00:00
|
34
|
+
|
35
|
+
263 packages excluded due to repository priority protections
|
36
|
+
|
37
|
+
Package mysql-community-server-8.0.23-1.el7.x86_64 already installed and latest version
|
38
|
+
|
39
|
+
Nothing to do
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
```php
|
44
|
+
|
45
|
+
$ mysql --version
|
46
|
+
|
47
|
+
```
|
48
|
+
|
49
|
+
> mysql Ver 8.0.23 for Linux on x86_64 (MySQL Community Server - GPL)
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
|
15
61
|
### 発生している問題
|
16
62
|
|
17
63
|
|
@@ -20,128 +66,172 @@
|
|
20
66
|
|
21
67
|
```php
|
22
68
|
|
23
|
-
$
|
69
|
+
$ systemctl status mysqld.service
|
24
|
-
|
70
|
+
|
25
|
-
```
|
71
|
+
```
|
72
|
+
|
26
|
-
|
73
|
+
> ● mysqld.service - MySQL Server
|
74
|
+
|
27
|
-
|
75
|
+
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
|
76
|
+
|
77
|
+
Active: failed (Result: exit-code) since Sat 2021-02-06 04:37:47 UTC; 13s ago
|
78
|
+
|
79
|
+
Docs: man:mysqld(8)
|
80
|
+
|
81
|
+
http://dev.mysql.com/doc/refman/en/using-systemd.html
|
82
|
+
|
83
|
+
Process: 17375 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS (code=exited, status=1/FAILURE)
|
84
|
+
|
85
|
+
Process: 17289 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
|
86
|
+
|
87
|
+
Main PID: 17375 (code=exited, status=1/FAILURE)
|
88
|
+
|
89
|
+
Status: "Server startup in progress"
|
90
|
+
|
91
|
+
Error: 13 (Permission denied)
|
92
|
+
|
93
|
+
Feb 06 04:37:47 ip-172-31-37-66.ap-southeast-1.compute.internal mysqld_pre_systemd[17289]: 2021-0...
|
94
|
+
|
95
|
+
Feb 06 04:37:47 ip-172-31-37-66.ap-southeast-1.compute.internal mysqld_pre_systemd[17289]: 2021-0...
|
96
|
+
|
97
|
+
Feb 06 04:37:47 ip-172-31-37-66.ap-southeast-1.compute.internal mysqld[17375]: 2021-02-06T04:37:4...
|
98
|
+
|
99
|
+
Feb 06 04:37:47 ip-172-31-37-66.ap-southeast-1.compute.internal mysqld[17375]: 2021-02-06T04:37:4...
|
100
|
+
|
101
|
+
Feb 06 04:37:47 ip-172-31-37-66.ap-southeast-1.compute.internal mysqld[17375]: 2021-02-06T04:37:4...
|
102
|
+
|
103
|
+
Feb 06 04:37:47 ip-172-31-37-66.ap-southeast-1.compute.internal mysqld[17375]: 2021-02-06T04:37:4...
|
104
|
+
|
105
|
+
Feb 06 04:37:47 ip-172-31-37-66.ap-southeast-1.compute.internal systemd[1]: mysqld.service: main ...
|
106
|
+
|
107
|
+
Feb 06 04:37:47 ip-172-31-37-66.ap-southeast-1.compute.internal systemd[1]: Failed to start MySQL...
|
108
|
+
|
109
|
+
Feb 06 04:37:47 ip-172-31-37-66.ap-southeast-1.compute.internal systemd[1]: Unit mysqld.service e...
|
110
|
+
|
111
|
+
Feb 06 04:37:47 ip-172-31-37-66.ap-southeast-1.compute.internal systemd[1]: mysqld.service failed.
|
112
|
+
|
113
|
+
Hint: Some lines were ellipsized, use -l to show in full.
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
28
118
|
|
29
119
|
|
30
120
|
|
31
121
|
となったので、
|
32
122
|
|
33
|
-
[
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
```
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
```
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
ここまで読んで
|
146
|
-
|
147
|
-
|
123
|
+
[この記事](https://qiita.com/miriwo/items/e7afd5e1ae0de94f27c2)を参考に起動ログを確認
|
124
|
+
|
125
|
+
```php
|
126
|
+
|
127
|
+
sudo vi /var/log/mysqld.log
|
128
|
+
|
129
|
+
```
|
130
|
+
|
131
|
+
> 2021-02-06T04:19:01.653849Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.23) initializing of server in progress as process 15948
|
132
|
+
|
133
|
+
2021-02-06T04:19:01.655447Z 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting.
|
134
|
+
|
135
|
+
2021-02-06T04:19:01.655475Z 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.
|
136
|
+
|
137
|
+
2021-02-06T04:19:01.655552Z 0 [ERROR] [MY-010119] [Server] Aborting
|
138
|
+
|
139
|
+
2021-02-06T04:19:01.655679Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.23) MySQL Community Server - GPL.
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
/var/lib/mysql/が使用できないと書かれているようなので、下記コマンドで削除してもう一度試してみても変わりなしです。。
|
146
|
+
|
147
|
+
```php
|
148
|
+
|
149
|
+
sudo rm -rf /var/lib/mysql
|
150
|
+
|
151
|
+
```
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
```php
|
158
|
+
|
159
|
+
less /var/log/mysqld.log
|
160
|
+
|
161
|
+
```
|
162
|
+
|
163
|
+
> 2021-02-06T02:57:16.556954Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.23) initializing of server in progress as process 10685
|
164
|
+
|
165
|
+
2021-02-06T02:57:16.558684Z 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting.
|
166
|
+
|
167
|
+
2021-02-06T02:57:16.558710Z 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.
|
168
|
+
|
169
|
+
2021-02-06T02:57:16.558771Z 0 [ERROR] [MY-010119] [Server] Aborting
|
170
|
+
|
171
|
+
2021-02-06T02:57:16.558895Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.23) MySQL Community Server - GPL.
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
やはり/var/lib/mysql/についてのエラーが出るので/var/libからmysqlを削除してみて
|
176
|
+
|
177
|
+
削除できたことを確認後、もう一度実行しましたが同じエラーになったので起動ログをみてみましたが変わりなしです。
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
### その他試してみたこと
|
186
|
+
|
187
|
+
```php
|
188
|
+
|
189
|
+
$ journalctl -xe
|
190
|
+
|
191
|
+
```
|
192
|
+
|
193
|
+
> -- Unit mysqld.service has begun starting up.
|
194
|
+
|
195
|
+
Feb 06 05:43:35 ip-xxx.ap-southeast-1.compute.internal mysqld[21612]: 2021-02-06T05:43:35.277076Z 0 [System] [MY-010116]
|
196
|
+
|
197
|
+
Feb 06 05:43:35 ip-xxx.ap-southeast-1.compute.internal mysqld[21612]: 2021-02-06T05:43:35.279385Z 0 [ERROR] [MY-010187] [
|
198
|
+
|
199
|
+
Feb 06 05:43:35 ip-xxx.ap-southeast-1.compute.internal mysqld[21612]: 2021-02-06T05:43:35.280569Z 0 [ERROR] [MY-010119] [
|
200
|
+
|
201
|
+
Feb 06 05:43:35 ip-xxx.ap-southeast-1.compute.internal mysqld[21612]: 2021-02-06T05:43:35.280726Z 0 [System] [MY-010910]
|
202
|
+
|
203
|
+
Feb 06 05:43:35 ip-xxx.ap-southeast-1.compute.internal sudo[21540]: pam_unix(sudo:session): session closed for user root
|
204
|
+
|
205
|
+
Feb 06 05:43:35 ip-xxx.ap-southeast-1.compute.internal systemd[1]: mysqld.service: main process exited, code=exited, stat
|
206
|
+
|
207
|
+
Feb 06 05:43:35 ip-xxx.ap-southeast-1.compute.internal systemd[1]: Failed to start MySQL Server.
|
208
|
+
|
209
|
+
-- Subject: Unit mysqld.service has failed
|
210
|
+
|
211
|
+
-- Defined-By: systemd
|
212
|
+
|
213
|
+
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
|
214
|
+
|
215
|
+
--
|
216
|
+
|
217
|
+
-- Unit mysqld.service has failed.
|
218
|
+
|
219
|
+
--
|
220
|
+
|
221
|
+
-- The result is failed.
|
222
|
+
|
223
|
+
Feb 06 05:43:35 ip-xxx.ap-southeast-1.compute.internal systemd[1]: Unit mysqld.service entered failed state.
|
224
|
+
|
225
|
+
Feb 06 05:43:35 ip-xxx.ap-southeast-1.compute.internal systemd[1]: mysqld.service failed.
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
この他にもエラーを元に様々なブログを読みは試しを繰り返しましたが、お手上げ状態です、、
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
ここまで読んでいただきありがとうございました。
|
236
|
+
|
237
|
+
ご回答いただけますと幸いですm(_ _)m
|