Reputation: 2341
I'm trying to configure my rails application with MySQL. When start my application, i get this error
Can't connect to local MySQL server through socket '/opt/local/var/run/mysql5/mysqld.sock
I have installed rails in /opt/local/bin/rails folder.
MySQL is installed in /usr/local/mysql/ folder
What do I need to do to make this work?
Thanks.
Upvotes: 1
Views: 638
Reputation: 2230
You need to find out where your socket is. If you have a mac it is normally /tmp/mysql.sock. then go into your config/database.yml file and change the socket.
development:
adapter: mysql2
database: your_db
username: root
socket: /tmp/mysql.sock
Good luck.
Upvotes: 6