I’m trying to set the privileges for two databases at once. I know it is possible to assign them in two statements. Is there a way to do it in one?
I tried
GRANT ALL PRIVILEGES
ON mydb1.*, mydb2.*
TO 'reader'@'localhost'
IDENTIFIED BY 'mypassword';
But it only seems to work for one database.
No you can’t, as you can see in the GRANT syntax diagram. Although apparently, you can use the wildcard
*.*to apply the grant to all databases, but I wouldn’t do that.