I'm using mysql2 gem on rails 5. Also I use AWS Cloud9 EC2 instance for development if that helps.
Here is error I'm getting:
$ RAILS_ENV=development bundle exec rake db:setup
rake aborted!
Mysql2::Error::ConnectionError:
Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2)
Here is my database.yml file:
development:
adapter: mysql2
socket: /var/mysql/mysql.sock
database: wagn_development
username: user
password: user
host: localhost
test:
adapter: mysql2
socket: /var/mysql/mysql.sock
database: wagn_test
username: user
password: user
host: localhost
production:
adapter: mysql2
socket: /var/mysql/mysql.sock
database: wagn_production
username: user
password: user
host: localhost
How to solve the error?