LoginSignup
0
0

More than 3 years have passed since last update.

【AWS EC2】Mysql2::Error: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'

Last updated at Posted at 2019-11-17

あなたのターミナルにはこんなエラーが出てますか?

[ec2-user@ip-XXX-XX-XX-XX chat-space2]$ rails db:create
Mysql2::Error: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'

このようなエラーがでた場合、mysqlが起動していない可能性があります。
起動し直し、再度DB作成コマンドを打ち込むことで解決できるかと思います。

入力するコマンド

$ sudo service mysqld start
 #=> Starting mysqld:                                     [  OK  ]

OKとなったら再度DB作成しましょう。

$ rails db:create RAILS_ENV=production

終わりに

お互いにエラーにめげずに頑張りましょう!

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
0
0