How to get Django to work with MySQL in XAMPP?

偶尔善良 提交于 2019-12-18 18:06:25

问题


I installed XAMPP on my Mac (Snow Leopard) and installed Django. How do I tell Django to use this and when I fire up python manage.py runserver I get this error:

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

How do I tell Django to use this instead?

/Applications/XAMPP/xamppfiles/var/mysql/mysql.sock

回答1:


Put that in the HOST entry for the database in the settings.




回答2:


simple solution is that just install Django Stack for Xampp. Not need to configure any thing every thing is configured already

https://wiki.bitnami.com/Infrastructure_Stacks/BitNami_Django_Stack



来源:https://stackoverflow.com/questions/6051043/how-to-get-django-to-work-with-mysql-in-xampp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!