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
- OSUbuntu 26.04 LTS (resolute)
- MySQL8.4.10-0ubuntu0.26.04.1
- Authcaching_sha2_password
- TimeAbout 13 min
- Reviewed27 August 2026
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.
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| db-a01 | 192.168.0.81 | Ubuntu 26.04 LTS | Primary / Source / Replica Set Member 1 | 2 Core | 4 GB | 50 GB |
Before you start
- The
reportingaccount from the previous guide.
-
Grant read access to one schema
-
Read the grants back
-
Confirm the read works
-
Try to write, and get a different error