Open Gauravbtc opened 2 years ago
Mysql2::Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock'
Please check out the first or second answer. I solved it with the first answer.
First, go to database.yml
Change host: localhost to host: 127.0.0.1
That's it!
I haven't tried the second one, which looks more related to the root cause.
Hi there
Thanks in advance!!
I set up rails application with rails 6, docker, and AWS Mysql RDS.
When I execute the command like rails db:migrate It will migrate necessary tables and columns into the database but at the last, it will raise errors like "rails aborted!" "Mysql2::Error::ConnectionError: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)"
due to that codebuild is not passing
I have already specifics the socket file path into database.yml but it's won't working at all.
I install mysql_client, default-libmysqlclient-dev , i tried to override /etc/mysql/my.cnf configuration but it won't work at all
database.yml
Dockerfile
mysql.cnf
can anyone let me know what should i do next to fix this error