如何让 Django 在 XAMPP 中与 MySQL 一起工作?
我在 Mac(Snow Leopard)上安装了 XAMPP 并安装了 Django。我如何告诉 Django 使用它,当我启动 python manage.py runserver 时,我收到此错误:
...
_mysql_exceptions.OperationalError: (2002, "Can't connect to local MySQL server through socket '/opt/local/var/run/mysql5/mysqld.sock' (2)")
如何告诉 Django 使用它?
/Applications/XAMPP/xamppfiles/var/mysql/mysql.sock
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将其放入设置中数据库的
HOST
条目中。Put that in the
HOST
entry for the database in the settings.简单的解决方案是只需为 Xampp 安装 Django Stack。不需要配置任何东西,每件事都已经配置
https://wiki.bitnami.com/Infrastruction_Stacks/BitNami_Django_Stack< /a>
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