We have a production MySQL server with the following grants:
mysql> show grants for the_db;
+------------------------------------------------------------------------------------------------------------+
| Grants for db_user@% |
+------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'db_user'@'%' IDENTIFIED BY PASSWORD '*A236932DB5549260BDC088C4BC2F0C6DB04424D7' |
| GRANT ALL PRIVILEGES ON `xydb`.* TO 'db_user'@'%' |
| GRANT SELECT ON `xyie-db`.* TO 'db_user'@'%' |
| GRANT SELECT ON `supportdb`.* TO 'db_user'@'%' |
| GRANT SELECT ON `xbs`.* TO 'db_user'@'%' |
+------------------------------------------------------------------------------------------------------------+
Is it possible to block access to these databases for a specific host? We have a new server coming online that will be using other test databases on the same server. I don't want the new server to be able to accidentally do anything on the production databases.
I understand I can use REVOKE access, but I'm not sure if that requires altering the existing GRANTS to be more specific to the hosts that they allow. I don't want to guess as the production dbs here are in constant use and accidentally blocking access for the live host would be bad.
Ideally I need to be able to just say:
BLOCK ACCESS ON 'xydb'.* TO 'db_user'@'192.168.1.4'