I am running rake db:setup on my server, and I am getting:
Can't connect to local MySQL server through socket '/tmp/mysql.sock'
(I added RAILS_ENV=production)
This is on a ubuntu, nginx, passenger, mysql setup.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Either MySQL isn’t running, or it’s not configured to put the sock-file in the right place. Run something like
ps aux | grep mysqlto check if it’s running. If it’s running and the error persists, check if the file/tmp/mysql.sockexists. You can configure it in/etc/mysql/my.cnfOn my ubuntu machine its configured to
/var/run/mysqld/mysqld.sock. Either change your mysql settings, or changeconfig/database.ymlin your Rails app.