1142 MySQL Origin: Data Last updated 15 Oct 2026

MySQL ERROR 1142 (42000): SELECT command denied to user 'x'@'host' for table 'y'

The account lacks the privilege for that statement on that table.

Exact message you may see command denied to user
Seen on: MySQL

Meaning

Users often have privileges on one database but not another, or lack ALTER/CREATE/TRIGGER needed by migrations.

Common causes

  • Missing GRANT for the statement type
  • Privileges on a different database
  • Views/triggers needing extra privileges

⚡ Quick fix

  1. GRANT the needed privileges
  2. Use separate migration and app users deliberately
  3. Check SHOW GRANTS

Detailed fix by platform

MySQL

  1. GRANT SELECT, INSERT, UPDATE, DELETE ON appdb.* TO 'app'@'%';

How to diagnose

  1. Privilege — Which command?
  2. Grants — SHOW GRANTS FOR user

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Data. Errors that are often confused with or caused by this one (click to open):

1044 — MySQL ERROR 1044 (42000): Access denied for user to database (MySQL)10441045 — MySQL ERROR 1045 (28000): Access denied for user (MySQL)10451130 — MySQL ERROR 1130 (HY000): Host 'x' is not allowed to connect to this MySQL server (MySQL)11301227 — MySQL ERROR 1227 (42000): Access denied; you need (at least one of) the SUPER privilege(s) for this operation (MySQL)122742501 — PostgreSQL: ERROR: permission denied for table / schema public (PostgreSQL)42501create extension denied — ERROR: permission denied to create extension "x" — Must be superuser to create this extension. (PostgreSQL)create extension deni…1142

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.