I've MySQL running through XAMPP, and I've also installed MySQLdb for python installed. I, however cannot figure out a way of using my XAMPP's MySQL for Python. Each time I execute python manage.py runserver it shows an error:
..2.4c1-py2.7-win32.egg.tmp\MySQLdb\connections.py", line 187, in __init__
_mysql_exceptions.OperationalError: (2003, "Can't connect to MySQL server on 'localhost' (10061)")
I'm new to Python and these are the settings in settings.py file:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'tester', # Or path to database file if using sqlite3.
'USER': 'root', # Not used with sqlite3.
'PASSWORD': 'password', # Not used with sqlite3.
'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for default. Not used with sqlite3.
}
}
I'm using Django. If I use SQLite3 instead of MySQL, it works fine. But I wanted to use MySQL.
EDIT#1
MySQL is using port: 3306. How do I get them working?
python manage.py runservercommand.PORT. Did you try filling that in?3306and8000both. Still no use.