CertGrid CertGrid
Hands-on Lab·MySQL

MySQL Privileges and GRANT

Grant `SELECT` on one schema and the account can read it and nothing else. The write attempt that follows fails with a different error from the last guide's - 1142, not 1044 - and the difference is the diagnosis.

Users and Privileges Guide 17 of 45 Beginner

Written against the versions above. `GRANT` no longer creates accounts implicitly in MySQL 8; `CREATE USER` first is required. Older scripts that rely on the implicit form fail on 8.x.

Every command on this page ran on db-a01.
Server NameIP AddressOSRolesCPURAMHDD
db-a01192.168.0.81Ubuntu 26.04 LTSPrimary / Source / Replica Set Member 12 Core4 GB50 GB

Before you start

  1. Grant read access to one schema

  2. Read the grants back

  3. Confirm the read works

  4. Try to write, and get a different error

Official sources