# 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`
- **Domain:** python
- **Category:** system_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

MySQL server is not running or socket path is incorrect.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.x | active | — | — |

## Workarounds

1. **** (85% success)
   ```
   Start MySQL service: sudo systemctl start mysql
   ```

## Dead Ends

- **** — May still fail if MySQL is not running. (40% fail)
- **** — Doesn't fix the database server issue. (30% fail)
