Help us understand the problem. What is going on with this article?

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

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

[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

終わりに

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

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away