Skip to content

Commit 00f2d7c

Browse files
jipengfei-jpfclaude
andcommitted
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>
1 parent 6c45087 commit 00f2d7c

41 files changed

Lines changed: 6071 additions & 1834 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎pages/blog/mongodb-aggregation-to-sql.mdx‎

Lines changed: 567 additions & 0 deletions
Large diffs are not rendered by default.

‎pages/blog/mysql-error-1040-too-many-connections.mdx‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ ORDER BY time DESC
159159
LIMIT 30;
160160
```
161161

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).
163163

164164
## Step 3: Relieve the Immediate Pressure
165165

@@ -197,7 +197,7 @@ The default `wait_timeout` is 28800 seconds (8 hours). A leaked connection can s
197197
SET GLOBAL wait_timeout = 600;
198198
```
199199

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).
201201

202202
## Step 4: Fix the Cause
203203

@@ -279,7 +279,7 @@ This worst case is rarely reached, but if it is far beyond the RAM of the host,
279279

280280
### Useful Concurrency
281281

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.
283283

284284
### File Descriptor Limits
285285

@@ -307,7 +307,7 @@ If you use MySQL Shell or connectors over the X Protocol (port 33060), those con
307307

308308
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.
309309

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).
311311

312312
## FAQ
313313

‎pages/blog/mysql-error-1054-unknown-column.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ When a 1054 is not obvious, work through this list in order:
499499

500500
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).
501501

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.
503503

504504
## FAQ
505505

‎pages/blog/mysql-error-1055-only-full-group-by.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ WHERE rn = 1;
216216
+-------------+----------+----------+--------+---------------------+
217217
```
218218

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](/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).
220220

221221
On MySQL 5.7, which has no window functions, join back to the aggregated keys:
222222

‎pages/blog/mysql-error-1062-duplicate-entry.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import Authors, { Author } from "components/authors";
1818

1919
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.
2020

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).
2222

2323
## Reproducing MySQL Error 1062
2424

‎pages/blog/mysql-error-1064-syntax-error.mdx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ CREATE USER 'app'@'%' IDENTIFIED BY 'secret';
262262
GRANT SELECT ON demo.* TO 'app'@'%';
263263
```
264264

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).
266266

267267
## Cause 5: Syntax From Another SQL Dialect
268268

@@ -347,7 +347,7 @@ WHERE id IN (
347347
);
348348
```
349349

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).
351351

352352
## Cause 6: Stored Programs Without DELIMITER
353353

‎pages/blog/mysql-error-1071-specified-key-too-long.mdx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,13 +200,13 @@ INSERT INTO u9 VALUES
200200
ERROR 1062 (23000): Duplicate entry 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' for key 'u9.url'
201201
```
202202

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).
204204

205205
Other prefix index limitations:
206206

207207
- They cannot be used as covering indexes, because the index does not contain the full value.
208208
- 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).
210210
- `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`.
211211

212212
### Watch Out for Non-Strict Mode

‎pages/blog/mysql-error-1175-safe-update-mode.mdx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ DELIMITER ;
316316
CALL purge_sessions('2026-09-01 00:00:00', 10000);
317317
```
318318

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](/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).
320320

321321
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.
322322

@@ -326,7 +326,7 @@ MariaDB supports the same `sql_safe_updates` variable, the same error 1175, and
326326

327327
## When the error number is different
328328

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).
330330

331331
## FAQ
332332

0 commit comments

Comments
 (0)