質問編集履歴
5
誤字
title
CHANGED
File without changes
|
body
CHANGED
@@ -99,7 +99,7 @@
|
|
99
99
|
#### 参考
|
100
100
|
- [Homebrewで入れたMySQLのmy-xxx.cnfの場所とmy.cnfの設置](https://qiita.com/madai0517/items/4df3ac0ce002301c7059)
|
101
101
|
|
102
|
-
###
|
102
|
+
### 4. ERROR! The server quit without updating PID file (/usr/local/var/mysql/Hoge.local.pid).
|
103
103
|
|
104
104
|
```
|
105
105
|
hoge@Hoge ~ % mysql.server start
|
4
ls /usr/local/var/mysql/*.pidの追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -115,4 +115,11 @@
|
|
115
115
|
2021-01-03T04:17:13.716502Z 0 [ERROR] Could not create unix socket lock file /tmp/mysql.sock.lock.
|
116
116
|
2021-01-03T04:17:13.716529Z 0 [ERROR] Unable to setup unix socket lock file.
|
117
117
|
2021-01-03T04:17:13.716544Z 0 [ERROR] Aborting
|
118
|
+
```
|
119
|
+
|
120
|
+
- `ls /usr/local/var/mysql/*.pid`
|
121
|
+
|
122
|
+
```
|
123
|
+
hoge@Hoge ~ % ls /usr/local/var/mysql/*.pid
|
124
|
+
zsh: no matches found: /usr/local/var/mysql/*.pid
|
118
125
|
```
|
3
質問番号1, 4の修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -2,9 +2,9 @@
|
|
2
2
|
|
3
3
|
MySQLを起動するため,次の問題を解決したい.
|
4
4
|
|
5
|
-
1. my.
|
5
|
+
1. my.cnfが自動で作成されない.
|
6
|
-
2. Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
|
6
|
+
2. ~~Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) ~~
|
7
|
-
3. Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (38)
|
7
|
+
3. ~~Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (38)~~
|
8
8
|
4. ERROR! The server quit without updating PID file (/usr/local/var/mysql/Hoge.local.pid).
|
9
9
|
|
10
10
|
### 環境
|
@@ -78,192 +78,41 @@
|
|
78
78
|
|
79
79
|
### 1. my.cnfが自動で作成されない
|
80
80
|
|
81
|
-
|
81
|
+
#### アプローチ
|
82
82
|
|
83
|
-
```
|
84
|
-
hoge@Hoge ~ % sudo vim /etc/my.cnf
|
85
|
-
Password:
|
86
|
-
hoge@Hoge ~ % mysql.server start
|
87
|
-
Starting MySQL
|
88
|
-
|
83
|
+
- `/usr/local/Cellar/mysql@5.7/5.7.32/.bottle/etc/my.cnf`からコピーして`/usr/local/etc/my.cnf`とした.
|
89
|
-
```
|
90
84
|
|
91
85
|
```
|
92
|
-
[mysqld]
|
93
|
-
|
86
|
+
hoge@Hoge ~ % find /usr/local/Cellar/mysql@5.7 -name "my*.cnf"
|
87
|
+
/usr/local/Cellar/mysql@5.7/5.7.32/.bottle/etc/my.cnf
|
94
88
|
|
95
|
-
[client]
|
96
|
-
socket=/tmp/mysql.soc
|
97
|
-
```
|
98
89
|
|
99
|
-
#### 参考
|
100
|
-
- [Homebrewで入れたMySQLのmy-xxx.cnfの場所とmy.cnfの設置](https://qiita.com/madai0517/items/4df3ac0ce002301c7059)
|
101
|
-
- [[MySQL] my.cnf の設定方法 (Mac + Homebrew 編)](https://codenote.net/mysql/3579.html)
|
102
|
-
- [mampでのmy.cnfファイルの作り方がわかりません(mac)](https://teratail.com/questions/197701)
|
103
|
-
|
90
|
+
hoge@Hoge ~ % cp /usr/local/Cellar/mysql@5.7 /usr/local/etc/my.cnf
|
104
91
|
|
105
|
-
### 2. Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
|
106
92
|
|
107
|
-
#### エラー詳細
|
108
93
|
|
94
|
+
hoge@Hoge ~ % mysql --help | grep my.cnf
|
95
|
+
order of preference, my.cnf, $MYSQL_TCP_PORT,
|
96
|
+
/etc/my.cnf /etc/mysql/my.cnf /usr/local/etc/my.cnf ~/.my.cnf
|
109
97
|
```
|
110
|
-
hoge@Hoge ~ % mysql_secure_installation
|
111
98
|
|
112
|
-
Securing the MySQL server deployment.
|
113
|
-
|
114
|
-
Enter password for user root:
|
115
|
-
Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
|
116
|
-
```
|
117
|
-
|
118
|
-
#### アプローチ
|
119
|
-
|
120
|
-
```
|
121
|
-
hoge@Hoge ~ % sudo touch /tmp/mysql.sock
|
122
|
-
Password:
|
123
|
-
hoge@Hoge ~ % mysql_secure_installation
|
124
|
-
|
125
|
-
Securing the MySQL server deployment.
|
126
|
-
|
127
|
-
Enter password for user root:
|
128
|
-
Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (38)
|
129
|
-
```
|
130
|
-
|
131
99
|
#### 参考
|
100
|
+
- [Homebrewで入れたMySQLのmy-xxx.cnfの場所とmy.cnfの設置](https://qiita.com/madai0517/items/4df3ac0ce002301c7059)
|
132
101
|
|
133
|
-
|
102
|
+
### 2. ERROR! The server quit without updating PID file (/usr/local/var/mysql/Hoge.local.pid).
|
134
103
|
|
135
|
-
### 3. Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (38)
|
136
|
-
|
137
|
-
#### エラー詳細
|
138
|
-
|
139
104
|
```
|
140
|
-
hoge@Hoge ~ % mysql_secure_installation
|
141
|
-
|
142
|
-
Securing the MySQL server deployment.
|
143
|
-
|
144
|
-
Enter password for user root:
|
145
|
-
Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (38)
|
146
|
-
```
|
147
|
-
|
148
|
-
#### アプローチ
|
149
|
-
|
150
|
-
```
|
151
|
-
hoge@Hoge ~ % ls -la /tmp/mysql.sock
|
152
|
-
-rw-r--r-- 1 root _mysql 0 1 2 23:59 /tmp/mysql.sock
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
hoge@Hoge ~ % cd /tmp
|
157
|
-
hoge@Hoge /tmp % chown -R _mysql:wheel /tmp/mysql.sock
|
158
|
-
chown: /tmp/mysql.sock: Operation not permitted
|
159
|
-
hoge@Hoge /tmp % sudo chown -R _mysql:wheel /tmp/mysql.sock
|
160
|
-
Password:
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
hoge@Hoge
|
105
|
+
hoge@Hoge ~ % mysql.server start
|
165
106
|
Starting MySQL
|
166
|
-
./usr/local/Cellar/mysql@5.7/5.7.32/bin/mysqld_safe: line 626: /usr/local/var/mysql/Hoge.local.err: No such file or directory
|
167
|
-
Logging to '/usr/local/var/mysql/Hoge.local.err'.
|
168
|
-
/usr/local/Cellar/mysql@5.7/5.7.32/bin/mysqld_safe: line 144: /usr/local/var/mysql/Hoge.local.err: No such file or directory
|
169
|
-
/usr/local/Cellar/mysql@5.7/5.7.32/bin/mysqld_safe: line 198: /usr/local/var/mysql/Hoge.local.err: No such file or directory
|
170
|
-
/usr/local/Cellar/mysql@5.7/5.7.32/bin/mysqld_safe: line 885: /usr/local/var/mysql/Hoge.local.err: No such file or directory
|
171
|
-
/usr/local/Cellar/mysql@5.7/5.7.32/bin/mysqld_safe: line 144: /usr/local/var/mysql/Hoge.local.err: No such file or directory
|
172
|
-
ERROR! The server quit without updating PID file (/usr/local/var/mysql/Hoge.local.pid).
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
hoge@Hoge /tmp % mysql_secure_installation
|
177
|
-
|
178
|
-
Securing the MySQL server deployment.
|
179
|
-
|
180
|
-
Enter password for user root:
|
181
|
-
Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (38)
|
182
|
-
```
|
183
|
-
|
184
|
-
### 4. ERROR! The server quit without updating PID file (/usr/local/var/mysql/Hoge.local.pid).
|
185
|
-
|
186
|
-
####エラー詳細
|
187
|
-
|
188
|
-
```
|
189
|
-
hoge@Hoge /tmp % mysql.server start
|
190
|
-
Starting MySQL
|
191
|
-
./usr/local/Cellar/mysql@5.7/5.7.32/bin/mysqld_safe: line 626: /usr/local/var/mysql/Hoge.local.err: No such file or directory
|
192
|
-
Logging to '/usr/local/var/mysql/Hoge.local.err'.
|
193
|
-
/usr/local/Cellar/mysql@5.7/5.7.32/bin/mysqld_safe: line 144: /usr/local/var/mysql/Hoge.local.err: No such file or directory
|
194
|
-
/usr/local/Cellar/mysql@5.7/5.7.32/bin/mysqld_safe: line 198: /usr/local/var/mysql/Hoge.local.err: No such file or directory
|
195
|
-
/usr/local/Cellar/mysql@5.7/5.7.32/bin/mysqld_safe: line 885: /usr/local/var/mysql/Hoge.local.err: No such file or directory
|
196
|
-
/usr/local/Cellar/mysql@5.7/5.7.32/bin/mysqld_safe: line 144: /usr/local/var/mysql/Hoge.local.err: No such file or directory
|
197
|
-
ERROR! The server quit without updating PID file (/usr/local/var/mysql/Hoge.local.pid).
|
198
|
-
```
|
199
|
-
|
200
|
-
#### アプローチ
|
201
|
-
|
202
|
-
- `/usr/local/var/mysql`を作成すると,ファイルが自動で作成される
|
203
|
-
|
204
|
-
```
|
205
|
-
hoge@Hoge % mkdir /usr/local/var/mysql
|
206
|
-
hoge@Hoge % ls /usr/local/var/mysql
|
207
|
-
Hoge.local.err ca-key.pem client-cert.pem ib_buffer_pool ib_logfile1 private_key.pem server-cert.pem
|
208
|
-
auto.cnf ca.pem client-key.pem ib_logfile0 ibdata1 public_key.pem server-key.pem
|
209
|
-
hoge@Hoge /tmp % mysql_secure_installation
|
210
|
-
|
211
|
-
Securing the MySQL server deployment.
|
212
|
-
|
213
|
-
Enter password for user root:
|
214
|
-
Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (38)
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
hoge@Hoge /tmp % mysql.server start
|
219
|
-
Starting MySQL
|
220
107
|
.. ERROR! The server quit without updating PID file (/usr/local/var/mysql/Hoge.local.pid).
|
221
108
|
```
|
222
109
|
|
223
|
-
|
110
|
+
#### エラー詳細
|
111
|
+
- `/usr/local/var/mysql/Hoge.local.err`ERROR抜粋
|
224
112
|
|
225
113
|
```
|
226
|
-
hoge@Hoge /tmp % touch /usr/local/var/mysql/Hoge.local.pid
|
227
|
-
hoge@Hoge /tmp % ls /usr/local/var/mysql/
|
228
|
-
Hoge.local.err ca-key.pem client-cert.pem ib_buffer_pool ib_logfile1 private_key.pem server-cert.pem
|
229
|
-
auto.cnf ca.pem client-key.pem ib_logfile0 ibdata1 public_key.pem server-key.pem
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
114
|
+
2021-01-03T04:17:13.707342Z 0 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
|
234
|
-
Password:
|
235
|
-
hoge@Hoge /tmp % ls /usr/local/var/mysql/
|
236
|
-
Hoge.local.err auto.cnf ca.pem client-key.pem ib_logfile0 ibdata1 public_key.pem server-key.pem
|
237
|
-
Hoge.local.pid ca-key.pem client-cert.pem ib_buffer_pool ib_logfile1 private_key.pem server-cert.pem
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
hoge@Hoge /tmp % mysql.server start
|
242
|
-
Starting MySQL
|
243
|
-
.
|
115
|
+
2021-01-03T04:17:13.716502Z 0 [ERROR] Could not create unix socket lock file /tmp/mysql.sock.lock.
|
244
|
-
hoge@Hoge /tmp % ls /usr/local/var/mysql/
|
245
|
-
Hoge.local.err ca-key.pem client-cert.pem ib_buffer_pool ib_logfile1 private_key.pem server-cert.pem
|
246
|
-
|
116
|
+
2021-01-03T04:17:13.716529Z 0 [ERROR] Unable to setup unix socket lock file.
|
117
|
+
2021-01-03T04:17:13.716544Z 0 [ERROR] Aborting
|
247
|
-
```
|
118
|
+
```
|
248
|
-
|
249
|
-
## 補足
|
250
|
-
|
251
|
-
- 起動中のプロセスはなし
|
252
|
-
|
253
|
-
```
|
254
|
-
hoge@Hoge ~ % ps ax | grep mysql
|
255
|
-
16567 s000 S+ 0:00.01 grep mysql
|
256
|
-
```
|
257
|
-
|
258
|
-
- パスワードを求められる
|
259
|
-
|
260
|
-
```
|
261
|
-
hoge@Hoge ~ % mysql_secure_installation
|
262
|
-
|
263
|
-
Securing the MySQL server deployment.
|
264
|
-
|
265
|
-
Enter password for user root:
|
266
|
-
Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (38)
|
267
|
-
```
|
268
|
-
|
269
|
-
- `/usr/local/var/mysql/Hoge.local.err`
|
2
誤字の修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -76,7 +76,7 @@
|
|
76
76
|
==> Successfully started `mysql@5.7` (label: homebrew.mxcl.mysql@5.7)
|
77
77
|
```
|
78
78
|
|
79
|
-
### 1. my.cnfが作成されない
|
79
|
+
### 1. my.cnfが自動で作成されない
|
80
80
|
|
81
81
|
- 手動で作成する
|
82
82
|
|
@@ -97,7 +97,7 @@
|
|
97
97
|
```
|
98
98
|
|
99
99
|
#### 参考
|
100
|
-
- [Homebrewで入れたMySQLのmy-xxx.cnfの場所とmy.cnfの設置](https://
|
100
|
+
- [Homebrewで入れたMySQLのmy-xxx.cnfの場所とmy.cnfの設置](https://qiita.com/madai0517/items/4df3ac0ce002301c7059)
|
101
101
|
- [[MySQL] my.cnf の設定方法 (Mac + Homebrew 編)](https://codenote.net/mysql/3579.html)
|
102
102
|
- [mampでのmy.cnfファイルの作り方がわかりません(mac)](https://teratail.com/questions/197701)
|
103
103
|
- [基礎MySQL ~その2~ my.cnf (設定ファイル)](https://qiita.com/yoheiW@github/items/bcbcd11e89bfc7d7f3ff)
|
1
補足の追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -244,4 +244,26 @@
|
|
244
244
|
hoge@Hoge /tmp % ls /usr/local/var/mysql/
|
245
245
|
Hoge.local.err ca-key.pem client-cert.pem ib_buffer_pool ib_logfile1 private_key.pem server-cert.pem
|
246
246
|
auto.cnf ca.pem client-key.pem ib_logfile0 ibdata1 public_key.pem server-key.pem
|
247
|
-
```
|
247
|
+
```
|
248
|
+
|
249
|
+
## 補足
|
250
|
+
|
251
|
+
- 起動中のプロセスはなし
|
252
|
+
|
253
|
+
```
|
254
|
+
hoge@Hoge ~ % ps ax | grep mysql
|
255
|
+
16567 s000 S+ 0:00.01 grep mysql
|
256
|
+
```
|
257
|
+
|
258
|
+
- パスワードを求められる
|
259
|
+
|
260
|
+
```
|
261
|
+
hoge@Hoge ~ % mysql_secure_installation
|
262
|
+
|
263
|
+
Securing the MySQL server deployment.
|
264
|
+
|
265
|
+
Enter password for user root:
|
266
|
+
Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (38)
|
267
|
+
```
|
268
|
+
|
269
|
+
- `/usr/local/var/mysql/Hoge.local.err`
|