How to create an administrative MySQL user for Drupal databases
Working on configuring MySQL for our deployment system I was confronted with a little problem. To improve on safety it would be good to have an administrative user which may only create and drop users for our Drupal databases which have a common name pattern. Therefore I tried this GRANT statement: GRANT ALL ON
. All is well documented in the MySQL online manual page GRANT syntax.drupal\_%
.* TO 'drupal'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION
Next I entered the interactive mysql command line with my new user's credentials and tried to use it as intended: GRANT ALL ON
As you might guess, it didn't work. Why? Creating and dropping users requires the global CREATE USER privilege: drupal\_example
.* TO 'example'@'localhost'GRANT CREATE USER ON . TO 'drupal'@'localhost'
does the trick.
Comments
Post new comment