PHP error category
MySQL & MariaDB
Database server errors.
MySQL & MariaDB errors arise when database server errors affect an executing PHP application or its supporting service. Use the exact signature and runtime context to narrow the cause before changing configuration.
The guides in this category separate code defects from environment differences, show focused diagnostics, and favor site-scoped corrections that preserve unrelated applications.
Guides in this category
| Title | Pattern | Severity |
|---|---|---|
| Lost connection to MySQL server during query | SQLSTATE[HY000]: General error: 2013 Lost connection to MySQL server during query |
error |
| MySQL server has gone away | SQLSTATE[HY000]: General error: 2006 MySQL server has gone away |
error |
| SQLSTATE 23000 duplicate entry | SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'ada@example.test' for key 'users.email' |
error |
| SQLSTATE 23000 foreign key constraint fails | SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails |
error |
| SQLSTATE 40001 deadlock found | SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction |
error |
| SQLSTATE 42000 SQL syntax error | SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax |
error |
| SQLSTATE 42S02 table does not exist | SQLSTATE[42S02]: Base table or view not found: 1146 Table 'app.orders' doesn't exist |
error |
| SQLSTATE 42S22 unknown column | SQLSTATE[42S22]: Column not found: 1054 Unknown column 'user_nmae' in 'field list' |
error |
| SQLSTATE HY000 lock wait timeout | SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction |
error |
| SQLSTATE HY000 unknown database | SQLSTATE[HY000] [1049] Unknown database 'inventory' |
fatal |