mysql -u root -p -e "GRANT SELECT, INSERT, UPDATE, DELETE ON appdb.* TO 'app'@'localhost';"

Category: Databases & SQL

mysql -u root -p -e "GRANT SELECT, INSERT, UPDATE, DELETE ON appdb.* TO 'app'@'localhost';"

Grant limited DML privileges

Restricts the account to the four row-level operations, excluding DDL like DROP and ALTER. Tighten further with column-level grants for sensitive data. REVOKE ALL PRIVILEGES ON appdb.* FROM 'app'@'localhost'; undoes it.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.