How can I give one user the identical set of privileges as another (pre-existing) user?
I can do:
SHOW GRANTS FOR 'user1'
But not:
GRANT (SHOW GRANTS for 'user1') to 'user2';
or
CREATE USER 'user1' LIKE 'user2'
So I can't see a way programmatically add all these grants a different user2
in an SQL way (other than writing a script in an app language to iterate thru that SHOW GRANTS)
Maybe there is a way going to the mysql.user
table? Or is that a bad idea in general? I am not particularly knowledgeable about, or comfortable messing around with, that table.