| Code | 訊息 | 常見原因 | 處置 |
| 1040 | Too many connections | 超過 max_connections | 調大參數、連線池優化、檢查洩漏 |
| 1041 | Out of memory | 記憶體不足 | 調整 innodb_buffer_pool_size、查詢優化 |
| 1042 | Bad host / Can't get hostname | DNS 解析失敗、skip-name-resolve | /etc/hosts、啟用 skip-name-resolve |
| 1043 | Invalid connection | 協定不匹配、SSL 錯誤 | 驗證驅動版本、SSL 參數 |
| 1044 | Access denied for user to database | 資料庫級權限缺失 | GRANT ... ON db.* TO user |
| 1045 | Access denied (user/password) | 帳號/密碼錯誤、主機不匹配 | 確認 user@host、密碼、FLUSH PRIVILEGES |
| 1130 | Host not allowed to connect | 用戶 host 欄位不匹配 | 建立 user@'%' 或具體 IP |
| 1133 | User not found | 用戶不存在 | CREATE USER |
| 1141 | Command denied to user | 全域權限不足 | GRANT 對應權限 |
| 1142 | Command denied to table | 表級權限不足 | GRANT ON db.table |
| 1143 | Command denied to column | 欄位級權限不足 | GRANT ON db.table(col) |
| 1146 | Table doesn't exist | 表名錯誤、大小寫敏感、Schema 不對 | 確認 lower_case_table_names |
| 1147 | Undefined user for table access | 權限表損壞 | FLUSH PRIVILEGES、重建用戶 |
| Code | 訊息 | 常見原因 | 處置 |
| 1065 | Empty query | 送出空 SQL 字串 | 應用層攔截空查詢 |
| 1081 | Can't create socket | 檔案描述符耗盡、TCP 連接耗盡 | ulimit -n、net.core.somaxconn |
| 1114 | Table is full | MEMORY 引擎達 max_heap_table_size、磁碟滿 | 調整參數、轉 InnoDB |
| 1116 | Too many open tables | table_open_cache 過小 | 調大、關閉未用表 |
| 1158/1159/1160/1161 | Net error read/write/timeout | 網路不穩、防火牆、net_read_timeout/net_write_timeout 過小 | 檢查網路、調大逾時、持久連線 |
| 1177 | Can't open table | .frm/.ibd 損壞、鎖定 | CHECK TABLE、REPAIR TABLE |
| 1180 | Commit failed | Binlog 寫入失敗、磁碟錯誤 | 檢查 binlog、磁碟健康 |
| 1181 | Rollback failed | Undo log 損壞 | innodb_force_recovery |
| 1203 | User already has max connections | 單用戶連線數達 max_user_connections | 調大或連線池限流 |
| 1205 | Lock wait timeout | InnoDB 行鎖等待超時(預設 50s) | 優化長事務、索引、innodb_lock_wait_timeout |
| 1211 | User has no create user privilege | 無 CREATE USER 權限 | GRANT CREATE USER |
| 1216 | FK constraint fails (child) | 子表插入/更新無對應父鍵 | 先寫父表、檢查 FK 定義 |
| 1217 | FK constraint fails (parent) | 父表刪除/更新仍有子表引用 | 先處理子表、SET NULL/CASCADE |
| 1226 | User exceeded resource limits | MAX_QUERIES_PER_HOUR 等資源配額用盡 | 調整配額、優化查詢 |
| 1227 | Access denied; need SUPER/FILE privilege | 操作需高權限(如 SET GLOBAL、LOAD DATA) | 最小權限原則、特定操作暫時提權 |
| 1235 | This version doesn't support... | 功能需較高版本(如 CTE 需 8.0、窗口函數) | 升級或改寫相容語法 |