Forums

Can't connect to local MySQL server through socket HELP!!!

Everything worked fine for a long time until I reloaded web app. Running Django with MySQL. Now it says: "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)"

Settigns.py says:

DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'name',
'USER': 'username', 'PASSWORD': 'password', 'HOST': '',
'PORT': '',
} } For a long time it worked just fine. I haven't changed anything major to provoke that behaviour. When I change to

DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'username$name',
'USER': 'username', 'PASSWORD': 'password', 'HOST': 'mysql.server',
'PORT': 3306,
} } Now it says: "Access denied for user 'USERNAME'@'ip-10-120-213-181.ec2.internal' (using password: YES)", I'm sure password is correct.

PLEASE HELP!!!

Solved! Set 'PORT' to "" (nothing). Sorry, I panicked. I still don't understand why this happened all of the sudden???