Create a new mysql database for a Drupal site via the command line
This is the command I use in the mysql CLI, valid for Drupal 6 and 7.
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER
ON databasename.*
TO 'username'@'localhost' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;Note that Drupal 6 does not require the CREATE TEMPORARY TABLE and LOCK TABLES permissions but some tools like dbscripts might 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;
Add new comment