Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get Django to work with MySQL in XAMPP?

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
like image 656
Aufwind Avatar asked Dec 21 '22 13:12

Aufwind


2 Answers

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

like image 158
Ignacio Vazquez-Abrams Avatar answered Dec 28 '22 07:12

Ignacio Vazquez-Abrams


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

like image 23
jax Avatar answered Dec 28 '22 06:12

jax