In MySQL, how do you allow another user to create other users? In turn, those users should only be able to view some tables.
Asked
Active
Viewed 138 times
2 Answers
2
From MySQL's privileges documentation, the CREATE USER
privilege is the one you want:
GRANT CREATE USER ON *.* TO 'username'@'host'
For other privileges, read MySQL's GRANT
documentation.
Note, I've linked to MySQL 5.0 documentation. GRANT
hasn't changed much over the years, so any newer versions should also use the same syntax.

hrunting
- 953
- 4
- 7
-
Thanks. To make it work, I had to specify GRANT CREATE USER ON *.* TO 'username'@'host'... – Steve Bennett Feb 08 '13 at 05:15
-
I'll edit the answer. – hrunting Feb 08 '13 at 05:41
-
1Sorry, that should be `*.*` (star dot star). Stackoverflow ate my asterisks. – Steve Bennett Feb 11 '13 at 00:33
1
I think the answer is this:
GRANT INSERT on mysql.* to 'username';
GRANT RELOAD on *.* TO 'username'@'%';
Plus setting grant access on the relevant tables.

Steve Bennett
- 5,750
- 12
- 47
- 59
-
Or...I'm totally wrong. I got that from here: http://dev.mysql.com/doc/refman/5.1/en/adding-users.html – Steve Bennett Feb 08 '13 at 05:08