The generic syntax for GRANT is as following
GRANT [rights] on [database] TO [username@hostname] IDENTIFIED BY [password]
Now rights can be:
a) ALL privilages
b) Combination of CREATE, DROP, SELECT, INSERT, UPDATE and DELETE etc.
We can grant rights on all databse by using *.* or some specific database by database.* or a specific table by database.table_name.
CREATE USER ‘user01’@’localhost’ IDENTIFIED BY ‘mypass’;
GRANT ALL ON db1.* TO 'user01'@'localhost'; GRANT SELECT ON db2.invoice TO 'user01'@'localhost'; GRANT USAGE ON *.* TO 'user01'@'localhost' WITH MAX_QUERIES_PER_HOUR 90;