Drush quickstart command line: create database with specific name

Events happening in the community are now at Drupal community events on www.drupal.org.
fadrupal's picture

Hi Mike and all - first off thank you for Quickstart. It simplified things a lot and it was a great help.

I have a question on drush quickstart-create command line. I couldn't find any documentation on how to create a database with a name different from the domain name.

Example: domain name=example.dev database name=mydatabase1

Is this at all possible?

Thanks in advance

Comments

drush quickstart-create --help

karschsp's picture

Checkout drush quickstart-create --help which outlines all the parameters you can pass to quickstart-create. One of those is --db-url.

Hi karschsp - thanks - I

fadrupal's picture

Hi karschsp - thanks - I actually did try that - but it still created the database with the name of the domain rather than the database name I specified.

I used the following syntax

drush qc database --domain=example.dev --db-url=mydatabase1 --dbuser=mydatabase1 --dbpassword=password

and I got

Creating database: example_dev [ok]
... [ok]
done.
Command completed successfully. [success]

Any ideas as to whether the syntax I used was wrong?
thank you

Try... --db-url="mysql://user

karschsp's picture

Try...

--db-url="mysql://username:password@localhost/databasename"

I believe, in this case, you need to create the DB before running quickstart-create all

no joy

fadrupal's picture

thanks again Steve - no joy unfortunately

replicating the full command

drush qc database --domain=example.dev --db-url="mysql://mydatabase1:password@localhost/mydatabase1"

and I got

Creating database: example_dev [ok]
... [ok]
done.
Command completed successfully. [success]

I even tried without the domain at all, but that is a required parameter

Also "sql-create" will do this.

heykarthikwithu's picture

Also "sql-create" will do this.

drush sql-create --db-su=root --db-su-pw=rootpassword --db-url="mysql://drupal_db_user:drupal_db_password@127.0.0.1/drupal_db"

Thanks,
heykarthikwithu,
Dream it, Drupal it.