python
system_error
ai_generated
true
django.db.utils.OperationalError: (2002, "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)")
ID: python/django-db-connection-error
80%Fix Rate
86%Confidence
0Evidence
2024-12-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 3.x | active | — | — | — |
Root Cause
MySQL server is not running or socket path is incorrect.
generic中文
MySQL服务器未运行或套接字路径不正确。
Workarounds
-
85% success
Start MySQL service: sudo systemctl start mysql
Dead Ends
Common approaches that don't work:
-
40% fail
May still fail if MySQL is not running.
-
30% fail
Doesn't fix the database server issue.