Who can see what? MySQL's privilege system answers precisely: users are granted specific rights on specific databases, tables, or even columns. Least privilege is the guiding principle.
Key Points
- Create: CREATE USER 'analyst'@'%' IDENTIFIED BY 'strong_pass';
- Grant read-only: GRANT SELECT ON sales_db.* TO 'analyst'@'%';
- Withdraw rights: REVOKE INSERT ON sales_db.* FROM 'analyst'@'%';
- Inspect anyone's rights: SHOW GRANTS FOR 'analyst'@'%';
- MySQL 8 roles bundle permissions: CREATE ROLE reporting; GRANT reporting TO user
- Give analysts SELECT-only accounts — nobody reports with root
.png)