1

I get the following error when I run the Django command "python manage.py syncdb"

_mysql_exceptions.OperationalError: (2002, "Can't connect to local MySQL server through socket '/opt/local/var/run/mysql5/mysqld.sock' (2)

I have installed python, django and py26-mysql using macports. I ran in to issues installing mysql through macports so I installed a standalone version.

What do I need to change so that django uses my standalone version of mysql and not macports version of mysql. I have verified that only standalone server is running when I execute this command.

Thanks

1 Answer 1

5

Use the HOST setting in your settings file:

"HOST": '/path/to/your/socket.sock'
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks, I tried the following and it worked "HOST": '127.0.0.1'
This took me a while to figure out - thanks for making it easier ;-)

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.