Create a new mysql database for a Drupal site via the command line

This is the command I use in the mysql CLI. Note that Drupal 6 does not require the CREATE TEMPORARY TABLE and LOCK TABLES permissions but some tools like drush or dbscripts require them.

GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES
  ON db.*
  TO 'user'@'localhost' IDENTIFIED BY 'pass';

FLUSH PRIVILEGES;

Comments

Add new comment