Why not login to Qiita and try out its useful features?

We'll deliver articles that match you.

You can read useful information later.

0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

AWS EC2 未経験エンジニアがデプロイするまでにハマり&解決法 MYSQLの設定編➀

Last updated at Posted at 2020-06-17

参考にさせていただいた記事 
https://qiita.com/naoki_mochizuki/items/f795fe3e661a3349a7ce

➀MYsqlの設定について

まず当たり前ですがAWSのサーバー内でMYSQLにログインして、作業をしていく必要があります。
この記事でいえば

[naoki|mumu]$ sudo service mysqld start

これを実行して、hogehogeみたいな。
でも実行結果は

Redirecting to /bin/systemctl start mysqld.service
Failed to start mysqld.service: Unit not found.

なにこれ(困惑)

ちなみに正しい場合は

Redirecting to /bin/systemctl start mysqld.service

だけが表示される状態です。

解決方法

正解は僕の知る限り2パターン

➀MySQL5.7の導入

➁Amazon linux 2ではなく、Amazon linuxにしちゃう

(https://teratail.com/questions/163564)

どちらかで対応しますが私は今回1番で対応しました。
MYSQLの5.7にする方法は下の参考文献に譲ります。

ただ、5.7に改インストールできれば
sudo service mysqld start
結果

Redirecting to /bin/systemctl start mysqld.service

これが表示されるかもしれませんが

rake db:create RAILS_ENV=production
```これが通らない。ORZなぜ・・・

理由はサーバーにログインで来ていないためです。
そこで大切なのは、MYSQLには初期でランダムにパスワードが設定されていたからだった。
だからルートユーザーでもなぜかparmission denedが表示されていたんですか・・・

そのため、ランダムに生成されるmysqlの設定を変更する必要がある、そしてそれが変更できれば

rake db:create RAILS_ENV=production

これが通るようになるわけなんですね。

##### ここから先にもたくさんのエラーと戦わなければいけない為大変だと思いますが、
##### 僕の分かる範囲で質問に対して答えられればと思いますのでお気軽にコメントください!



参考(mysqlのインストール)
https://qiita.com/hamham/items/fd77bb0bb167a150dc8e#mysql57%E3%81%AE%E5%B0%8E%E5%85%A5
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up

Qiita Conference 2025 will be held!: 4/23(wed) - 4/25(Fri)

Qiita Conference is the largest tech conference in Qiita!

Keynote Speaker

ymrl、Masanobu Naruse, Takeshi Kano, Junichi Ito, uhyo, Hiroshi Tokumaru, MinoDriven, Minorun, Hiroyuki Sakuraba, tenntenn, drken, konifar

View event details
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?