I had to use two GRANT queries to maximize permissions for a new user on RDS MySQL.
As others have mentioned, this query grants full permissions to all databases except certain system databases (Note the `%`
instead of *
):
GRANT ALL PRIVILEGES ON `%`.* TO 'myuser'@'host';
For my needs, I also needed as many permissions as possible on the systems tables (so this user could, for example, create new users). For that, I found I could specify all permissions EXCEPT CREATE TABLESPACE
, FILE
, SHUTDOWN
, and SUPER
globally:
GRANT EXECUTE, PROCESS, SELECT, SHOW DATABASES, SHOW VIEW, ALTER, ALTER ROUTINE, CREATE, CREATE ROUTINE,
DELETE, CREATE VIEW, INDEX, EVENT, DROP, TRIGGER, REFERENCES, INSERT, CREATE USER,
UPDATE, RELOAD, LOCK TABLES, REPLICATION SLAVE, REPLICATION CLIENT, CREATE TEMPORARY TABLES ON *.* TO 'myuser'@'host' WITH GRANT OPTION;
I imagine the exact list of allowed permissions may change with new versions of MySQL and over time, so hopefully this answer doesn't age too quickly.
Edit: Credit where credit is due - most of this I figured out thanks to this blog post on the issue. I found a slightly different list of disallowed permissions: http://www.fidian.com/problems-only-tyler-has/using-grant-all-with-amazons-mysql-rds
"someuser"@"10.0.0.%"