Reputation: 32833
Hi I am working on ruby on rails project. after setting up all environment for the project but when I run localhost:3000 on my web browser it gives my this error
Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (38)
Can someone help me how can I solve this problem?
Upvotes: 0
Views: 514
Reputation: 5967
Rails by default tries to connect to MySQL using a socket file. You probably want it to connect using a TCP connection.
Check your database.yml; it should look similar to this:
development:
adapter: mysql2
encoding: utf8
reconnect: true
host: localhost
database: {database name}
pool: 5
username: {username}
password: {password}
Notice the host
parameter and the missing socket
parameter.
Upvotes: 1