1

I run Ubuntu using VirtualBox on Windows 7.

When I launch "localhost:3000" (after I ran rails s), I got the following error:

Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

I installed XAMPP on Ubuntu, so my MySQL installation seems to be here: /opt/lampp/var/mysql (mysql.sock is there)

How should I connect my rails application to this MySQL installation ?

1 Answer 1

5

try the socket param in your database.yml (it defaults to /tmp/mysql.sock I think)

development:
adapter: mysql
encoding: utf8
database: yourapp_development
username: youruser
password: yourpassword
socket: /opt/lampp/var/mysql/mysql.sock
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.