- Grant the READ ONLY(SELECT) privileges to the company_read_only user:
mysql> GRANT SELECT ON company.* TO 'company_read_only'@'localhost';Query OK, 0 rows affected (0.06 sec)
The asterisk (*) represents all tables inside the database.
- Grant the INSERT privilege to the new company_insert_only user:
mysql> GRANT INSERT ON company.* TO 'company_insert_only'@'localhost' IDENTIFIED BY 'xxxx';Query OK, 0 rows affected, 1 warning (0.05 sec)
mysql> SHOW WARNINGS\G*************************** 1. row *************************** Level: Warning Code: 1287Message: Using GRANT for creating new user is deprecated and will be removed in future release. Create new user with CREATE USER statement.1 row in set (0.00 sec)
- Grant the