GRANT
CautionGrant privileges
GRANT SELECT ON db.table TO 'user'@'host';
Grants privileges — least privilege always; app users never need DROP.
Examples
GRANT SELECT, INSERT, UPDATE ON app.* TO 'webapp'@'10.0.%';Minimal app grants
Syntax
GRANT <privs> ON <db.obj> TO 'user'@'host';
Before you run it
Over-granting invites disasters.
Related commands
- REVOKERevoke privileges
- CREATE USERCreate database users
- SHOW GRANTSShow grants
The same reference, with no signal at all
Every command and flow from this site, held on your device and searchable with no connection. Free to install, no ads.
Get it free on the App Store