質問編集履歴

4

追加の記述

2022/02/01 12:10

投稿

senseIY
senseIY

スコア281

test CHANGED
File without changes
test CHANGED
@@ -165,3 +165,91 @@
165
165
 
166
166
  ```
167
167
  変化なしでした。
168
+
169
+ ### さらに追記
170
+ 現在my.cnfが間違っているのではないかと思ったので調査中です。一応3パターン試してみたのですが、どれもうまく行きませんでした。
171
+
172
+
173
+ 1つ目 (初期状態)
174
+ ```
175
+ # Copyright (c) 2015, 2021, Oracle and/or its affiliates.
176
+ #
177
+ # This program is free software; you can redistribute it and/or modify
178
+ # it under the terms of the GNU General Public License, version 2.0,
179
+ # as published by the Free Software Foundation.
180
+ #
181
+ # This program is also distributed with certain software (including
182
+ # but not limited to OpenSSL) that is licensed under separate terms,
183
+ # as designated in a particular file or component or in included license
184
+ # documentation. The authors of MySQL hereby grant you an additional
185
+ # permission to link the program and your derivative works with the
186
+ # separately licensed software that they have included with MySQL.
187
+ #
188
+ # This program is distributed in the hope that it will be useful,
189
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
190
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
191
+ # GNU General Public License, version 2.0, for more details.
192
+ #
193
+ # You should have received a copy of the GNU General Public License
194
+ # along with this program; if not, write to the Free Software
195
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
196
+
197
+ #
198
+ # The MySQL Server configuration file.
199
+ #
200
+ # For explanations see
201
+ # http://dev.mysql.com/doc/mysql/en/server-system-variables.html
202
+
203
+ # * IMPORTANT: Additional settings that can override those from this file!
204
+ # The files must end with '.cnf', otherwise they'll be ignored.
205
+ #
206
+
207
+ !includedir /etc/mysql/conf.d/
208
+ !includedir /etc/mysql/mysql.conf.d/
209
+ ```
210
+ 2つ目
211
+ ```
212
+ [mysqld]
213
+ socket=/tmp/mysql.sock
214
+
215
+ [client]
216
+ soket=/tmp/mysql.sock
217
+ ```
218
+ 3つ目
219
+ ```
220
+ [vagrant@asianux7 ~]$ sudo vi /etc/my.cnf
221
+ [mysqld]
222
+ datadir=/var/lib/mysql
223
+ socket=/var/lib/mysql/mysql.sock
224
+ symbolic-links=0
225
+ character-set-server=utf8
226
+ #default_password_lifetime = 0 ←**ここを削除**
227
+
228
+ [mysqld_safe]
229
+ log-error=/var/log/mariadb/mariadb.log
230
+ pid-file=/var/run/mariadb/mariadb.pid
231
+
232
+ !includedir /etc/mysql/mysql.cnf.d
233
+ ```
234
+ #それぞれのエラー
235
+ 上から順に初期、2つ目、3つ目
236
+ ```
237
+ ➜ dictation_app git:(master) ✗ mysql -u root
238
+ ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111)
239
+
240
+ ➜ dictation_app git:(master) ✗ mysql -u root
241
+ mysql: [ERROR] unknown variable 'soket=/tmp/mysql.sock'.
242
+
243
+ ➜ dictation_app git:(master) ✗ mysql -u root
244
+ mysql: Can't read dir of '/etc/mysql/mysql.cnf.d' (OS errno 2 - No such file or directory)
245
+ mysql: [ERROR] Stopped processing the 'includedir' directive in file /etc/mysql/my.cnf at line 48.
246
+ mysql: [ERROR] Fatal error in defaults handling. Program aborted!
247
+
248
+ ```
249
+ また、2つの参考にさせて頂いたサイトの文脈的にもともとの初期状態で
250
+ ```
251
+ [mysqld]
252
+
253
+ socket=/var/lib/mysql/mysql.sock
254
+ ```
255
+ のように記述されているらしいのですが自分のにはありませんでした。開いている場所が違うのでしょうか?パスは/etc/my.cnfです。

3

書式改善

2022/02/01 10:55

投稿

senseIY
senseIY

スコア281

test CHANGED
File without changes
test CHANGED
@@ -149,7 +149,8 @@
149
149
  ・入門者なので変な操作をしているかもしれません。
150
150
 
151
151
  何かアドバイスがあれば教えていただきたいです。よろしくお願い致します。
152
+
152
- 追記
153
+ ### 追記
153
154
  エラーに
154
155
  ```
155
156
  Please remove the file manually and start /home/linuxbrew/.linuxbrew/Cellar/mysql/8.0.28/bin/mysqld_safe again;

2

追加で情報更新

2022/02/01 10:54

投稿

senseIY
senseIY

スコア281

test CHANGED
File without changes
test CHANGED
@@ -149,4 +149,18 @@
149
149
  ・入門者なので変な操作をしているかもしれません。
150
150
 
151
151
  何かアドバイスがあれば教えていただきたいです。よろしくお願い致します。
152
+ 追記
153
+ エラーに
154
+ ```
155
+ Please remove the file manually and start /home/linuxbrew/.linuxbrew/Cellar/mysql/8.0.28/bin/mysqld_safe again;
152
156
 
157
+ ```
158
+ とあったので実行。しかしこのコマンドで検索しても2件しかヒットしなかったのでどんなコマンドか分からないけど、とりあえずやってみた。
159
+ ```
160
+ ➜ dictation_app git:(master) ✗ sudo /home/linuxbrew/.linuxbrew/Cellar/mysql/8.0.28/bin/mysqld_safe
161
+ 2022-02-01T10:46:07.812058Z mysqld_safe Logging to '/var/log/mysql/error.log'.
162
+ 2022-02-01T10:46:07.847246Z mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
163
+ 2022-02-01T10:47:48.265914Z mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
164
+
165
+ ```
166
+ 変化なしでした。

1

追加で試してみた操作を記載しました

2022/02/01 10:18

投稿

senseIY
senseIY

スコア281

test CHANGED
File without changes
test CHANGED
@@ -116,6 +116,22 @@
116
116
  sudo touch sense-iy-CFSZ5-3.pid
117
117
 
118
118
  ```
119
+ その後権利変更
120
+ ```
121
+ #なぜか参考にしたサイトに書かれていた通りにやるとエラーに
122
+ ➜ mysqld sudo chown -R _mysql:_mysql var/run/mysql
123
+ [sudo] sense_iy のパスワード:
124
+ chown: ユーザー指定が不正: `_mysql:_mysql'
125
+
126
+ #アンダーバー消したらうまくいったけど合っているか不明。なぜこのコマンドをして権利変更するのかもよくわからないけどとりあえず実行してみた。もともとrootだった部分がmysqlになった。
127
+ ➜ mysqld sudo chown -R mysql:mysql /var/run/mysqld
128
+ ➜ mysqld ls -l sense-iy-CFSZ5-3.pid
129
+
130
+ -rw-r--r-- 1 mysql mysql 0 2月 1 17:02 sense-iy-CFSZ5-3.pid
131
+
132
+
133
+ ```
134
+
119
135
  しかし変化なし。そもそも指示にしたがって消したのにもう一度作るのは少しおかしいのではと考えてその後いろいろなサイトを見るも、mariaDB(1度もインストールしてないです)関連の記事が多くどれが有効なのか分からず、ここで詰まって進めません。
120
136
 
121
137
  ###その他