1632
MySQLERRORNotablePerformance SchemaHIGH confidence

Incorrect usage of Performance Schema table

Production Risk

Low — the write is rejected; no data is corrupted.

What this means

An operation was attempted on a Performance Schema table that does not support it (e.g., trying to INSERT, UPDATE, or create an index on a read-only performance_schema table).

Why it happens
  1. 1Attempting DML operations on performance_schema tables that are read-only.
  2. 2Trying to create indexes or alter performance_schema tables.
How to reproduce
trigger — this will error
trigger — this will error
INSERT INTO performance_schema.events_waits_current VALUES (...);

expected output

ERROR 1632 (HY000): Cannot write to a PERFORMANCE_SCHEMA table.

Fix

Use performance_schema only for read queries

Use performance_schema only for read queries
SELECT * FROM performance_schema.events_waits_current;

Why this works

Performance schema tables are read-only metadata views; only SELECT is supported.

What not to do

Sources
Official documentation ↗

MySQL 8.0 — 1632 ER_WRONG_PERFSCHEMA_USAGE

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All MySQL errors