You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 00f2d7c
Browse filesBrowse the repository at this point in the historyBrowse files
feat(auto): add 9 posts — Postgres 18 RETURNING OLD/NEW, permission denied for schema public, pg_upgrade to 18, PostgreSQL to MySQL migration, MongoDB aggregation to SQL, MySQL errors 1451/1215, SQL Server errors 18456/1205; fix 78 double-prefixed /resources/blog links (2026-09-29 SEO run)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: pages/blog/mysql-error-1040-too-many-connections.mdx
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -159,7 +159,7 @@ ORDER BY time DESC
159
159
LIMIT30;
160
160
```
161
161
162
-
Many connections in `Sleep` with large `time` values point to leaks or oversized pools. Many connections in `Query` with a state such as `Waiting for table metadata lock` or long-running statements point to a blocking problem: one slow statement or lock holder is making everything else wait, and each waiting request keeps its connection. To track down row lock waits, see [MySQL Lock Wait Timeout Exceeded](/resources/blog/mysql-lock-wait-timeout-exceeded).
162
+
Many connections in `Sleep` with large `time` values point to leaks or oversized pools. Many connections in `Query` with a state such as `Waiting for table metadata lock` or long-running statements point to a blocking problem: one slow statement or lock holder is making everything else wait, and each waiting request keeps its connection. To track down row lock waits, see [MySQL Lock Wait Timeout Exceeded](/blog/mysql-lock-wait-timeout-exceeded).
163
163
164
164
## Step 3: Relieve the Immediate Pressure
165
165
@@ -197,7 +197,7 @@ The default `wait_timeout` is 28800 seconds (8 hours). A leaked connection can s
197
197
SET GLOBAL wait_timeout =600;
198
198
```
199
199
200
-
The new value applies to connections opened afterwards. Make sure every connection pool retires its connections before this timeout, otherwise the pool will hand out connections the server has already closed. Since MySQL 8.0.24, clients then receive `ERROR 4031 (HY000): The client was disconnected by the server because of inactivity`, and older drivers report a lost connection. If you see that after changing the timeout, see [MySQL Error 2013: Lost Connection During Query](/resources/blog/mysql-error-2013-lost-connection).
200
+
The new value applies to connections opened afterwards. Make sure every connection pool retires its connections before this timeout, otherwise the pool will hand out connections the server has already closed. Since MySQL 8.0.24, clients then receive `ERROR 4031 (HY000): The client was disconnected by the server because of inactivity`, and older drivers report a lost connection. If you see that after changing the timeout, see [MySQL Error 2013: Lost Connection During Query](/blog/mysql-error-2013-lost-connection).
201
201
202
202
## Step 4: Fix the Cause
203
203
@@ -279,7 +279,7 @@ This worst case is rarely reached, but if it is far beyond the RAM of the host,
279
279
280
280
### Useful Concurrency
281
281
282
-
A database can only run as many queries in parallel as it has CPU cores and I/O capacity. Past that point, extra concurrent queries just queue inside the server. That is why well-tuned pools are usually small: a common starting heuristic, popularized by the HikariCP documentation, is about twice the number of CPU cores of the database server, then adjusted by measurement. Use the [connection pool size calculator](https://chat2db.ai/tools/connection-pool-size-calculator) to work out a per-instance pool size from your core count, instance count, and headroom, and see the [HikariCP connection pool size guide](/resources/blog/hikaricp-connection-pool-size-guide) for the reasoning behind the numbers.
282
+
A database can only run as many queries in parallel as it has CPU cores and I/O capacity. Past that point, extra concurrent queries just queue inside the server. That is why well-tuned pools are usually small: a common starting heuristic, popularized by the HikariCP documentation, is about twice the number of CPU cores of the database server, then adjusted by measurement. Use the [connection pool size calculator](https://chat2db.ai/tools/connection-pool-size-calculator) to work out a per-instance pool size from your core count, instance count, and headroom, and see the [HikariCP connection pool size guide](/blog/hikaricp-connection-pool-size-guide) for the reasoning behind the numbers.
283
283
284
284
### File Descriptor Limits
285
285
@@ -307,7 +307,7 @@ If you use MySQL Shell or connectors over the X Protocol (port 33060), those con
307
307
308
308
A GUI helps a lot during step 4, when you want to sort and filter a few hundred processlist rows quickly. In [Chat2DB](https://app.chat2db.ai/) you can run the grouping queries above, sort the result grid by any column, and save the diagnostic queries for the next incident. For other connection errors you encounter, like 1203, 1226, or 1227, the free [MySQL error code lookup tool](https://chat2db.ai/tools/mysql-error-code-lookup) explains each code.
309
309
310
-
If you also run PostgreSQL, its equivalent error is covered in [PostgreSQL Too Many Clients Already](/resources/blog/postgres-too-many-clients-already-fix).
310
+
If you also run PostgreSQL, its equivalent error is covered in [PostgreSQL Too Many Clients Already](/blog/postgres-too-many-clients-already-fix).
Copy file name to clipboardExpand all lines: pages/blog/mysql-error-1054-unknown-column.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -499,7 +499,7 @@ When a 1054 is not obvious, work through this list in order:
499
499
500
500
Keeping the table structure visible next to the editor removes most of this guesswork. In [Chat2DB](https://chat2db.ai/download), autocomplete suggests real column names for each alias as you type, so misspelled or out-of-scope columns stand out before you run the query. For other error numbers you run into along the way, such as 1356 or 1146, you can look them up with the free [MySQL error code lookup tool](https://chat2db.ai/tools/mysql-error-code-lookup).
501
501
502
-
Related guides in this series: [MySQL Error 1064: You Have an Error in SQL Syntax](/resources/blog/mysql-error-1064-syntax-error) for parser errors, and [MySQL Error 1055: Fix only_full_group_by](/resources/blog/mysql-error-1055-only-full-group-by) for `GROUP BY` problems that often appear right after fixing a 1054.
502
+
Related guides in this series: [MySQL Error 1064: You Have an Error in SQL Syntax](/blog/mysql-error-1064-syntax-error) for parser errors, and [MySQL Error 1055: Fix only_full_group_by](/blog/mysql-error-1055-only-full-group-by) for `GROUP BY` problems that often appear right after fixing a 1054.
The `id DESC` tie-breaker makes the result deterministic when two orders share a timestamp. Use `RANK()` instead of `ROW_NUMBER()` if you want all tied rows. Window functions are covered in more depth in [MySQL Window Functions](/resources/blog/mysql-window-functions).
219
+
The `id DESC` tie-breaker makes the result deterministic when two orders share a timestamp. Use `RANK()` instead of `ROW_NUMBER()` if you want all tied rows. Window functions are covered in more depth in [MySQL Window Functions](/blog/mysql-window-functions).
220
220
221
221
On MySQL 5.7, which has no window functions, join back to the aggregated keys:
The immediate fix is usually obvious once you know which key was hit and which value collided. The harder cases are the ones where the "duplicate" does not look like a duplicate: a collation that treats `é` as `e`, an `AUTO_INCREMENT` column that ran out of range, or a replica that diverged from its source. This guide covers all of them on MySQL 8.0 and 8.4.
20
20
21
-
If you work with PostgreSQL as well, the equivalent error there is covered in [duplicate key value violates unique constraint](/resources/blog/postgres-duplicate-key-value-violates-unique-constraint).
21
+
If you work with PostgreSQL as well, the equivalent error there is covered in [duplicate key value violates unique constraint](/blog/postgres-duplicate-key-value-violates-unique-constraint).
Copy file name to clipboardExpand all lines: pages/blog/mysql-error-1064-syntax-error.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -262,7 +262,7 @@ CREATE USER 'app'@'%' IDENTIFIED BY 'secret';
262
262
GRANTSELECTON demo.* TO 'app'@'%';
263
263
```
264
264
265
-
Likewise, the `PASSWORD()` function is gone. `SELECT PASSWORD('x');` fails near `('x')`. Use `ALTER USER ... IDENTIFIED BY` to change passwords. If password problems follow the upgrade, see [MySQL Error 1045: Access Denied](/resources/blog/mysql-error-1045).
265
+
Likewise, the `PASSWORD()` function is gone. `SELECT PASSWORD('x');` fails near `('x')`. Use `ALTER USER ... IDENTIFIED BY` to change passwords. If password problems follow the upgrade, see [MySQL Error 1045: Access Denied](/blog/mysql-error-1045).
266
266
267
267
## Cause 5: Syntax From Another SQL Dialect
268
268
@@ -347,7 +347,7 @@ WHERE id IN (
347
347
);
348
348
```
349
349
350
-
The extra derived table is needed because MySQL does not allow `LIMIT` directly inside an `IN` subquery. Batching like this also keeps locks short; if large updates are timing out, see [MySQL Lock Wait Timeout Exceeded](/resources/blog/mysql-lock-wait-timeout-exceeded).
350
+
The extra derived table is needed because MySQL does not allow `LIMIT` directly inside an `IN` subquery. Batching like this also keeps locks short; if large updates are timing out, see [MySQL Lock Wait Timeout Exceeded](/blog/mysql-lock-wait-timeout-exceeded).
Copy file name to clipboardExpand all lines: pages/blog/mysql-error-1071-specified-key-too-long.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -200,13 +200,13 @@ INSERT INTO u9 VALUES
200
200
ERROR 1062 (23000): Duplicate entry 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' for key 'u9.url'
201
201
```
202
202
203
-
That is a false duplicate. If you need true uniqueness on a long value, use a hash column (Fix 4). For more on this error, see [MySQL Error 1062: Duplicate Entry](/resources/blog/mysql-error-1062-duplicate-entry).
203
+
That is a false duplicate. If you need true uniqueness on a long value, use a hash column (Fix 4). For more on this error, see [MySQL Error 1062: Duplicate Entry](/blog/mysql-error-1062-duplicate-entry).
204
204
205
205
Other prefix index limitations:
206
206
207
207
- They cannot be used as covering indexes, because the index does not contain the full value.
208
208
- They cannot satisfy `ORDER BY url` or `GROUP BY url` on their own.
209
-
- A foreign key cannot reference a prefix-indexed column. For related errors see [MySQL Error 1452](/resources/blog/mysql-error-1452-foreign-key-constraint-fails).
209
+
- A foreign key cannot reference a prefix-indexed column. For related errors see [MySQL Error 1452](/blog/mysql-error-1452-foreign-key-constraint-fails).
210
210
-`TEXT` and `BLOB` columns can only be indexed with a prefix. Without one you get `ERROR 1170 (42000): BLOB/TEXT column 'url' used in key specification without a key length`.
The same batching applies to bulk `UPDATE`s. When child tables reference the rows you delete, make sure the foreign key has `ON DELETE CASCADE` or delete children first; otherwise the batches fail with the errors described in [MySQL Error 1452: Foreign Key Constraint Fails](/resources/blog/mysql-error-1452-foreign-key-constraint-fails).
319
+
The same batching applies to bulk `UPDATE`s. When child tables reference the rows you delete, make sure the foreign key has `ON DELETE CASCADE` or delete children first; otherwise the batches fail with the errors described in [MySQL Error 1452: Foreign Key Constraint Fails](/blog/mysql-error-1452-foreign-key-constraint-fails).
320
320
321
321
If you prefer to run maintenance statements from a GUI, [Chat2DB](https://chat2db.ai/download) shows the affected row count for every statement and lets you keep a transaction open while you check it, which pairs well with batch deletes.
322
322
@@ -326,7 +326,7 @@ MariaDB supports the same `sql_safe_updates` variable, the same error 1175, and
326
326
327
327
## When the error number is different
328
328
329
-
Safe update mode only produces error 1175 (and error 1104 from `max_join_size` in client sessions started with `--safe-updates`). If your `UPDATE` fails with another code, such as a duplicate key error or an access denied error, see [MySQL Error 1062](/resources/blog/mysql-error-1062-duplicate-entry) or [MySQL Error 1045](/resources/blog/mysql-error-1045). You can also look up any MySQL error number and its meaning with the free [MySQL error code lookup tool](https://chat2db.ai/tools/mysql-error-code-lookup).
329
+
Safe update mode only produces error 1175 (and error 1104 from `max_join_size` in client sessions started with `--safe-updates`). If your `UPDATE` fails with another code, such as a duplicate key error or an access denied error, see [MySQL Error 1062](/blog/mysql-error-1062-duplicate-entry) or [MySQL Error 1045](/blog/mysql-error-1045). You can also look up any MySQL error number and its meaning with the free [MySQL error code lookup tool](https://chat2db.ai/tools/mysql-error-code-lookup).
0 commit comments