I think this is easy but some time you confuse like me and waste your time for trying to get multi database db info, user info, password info. Drush command docmention is not clear how to get multi database info here is simple example

drush sql-connect --database=databasekey

Comments

moshe weitzman’s picture

Don't see how we could be more clear. Perhaps you didn't think to read the help for sql-connect

Options:
 --database                                The DB connection key if using multiple connections in settings.php.
asghar’s picture

I had been studied sql-connect help but dont know how to pass argument .
I was tried by different techniques like
drush sql-connect --database 'databasekey',
drush sql-connect --database databasekey

after source code i have passed argument like this
drush sql-connect --database=databasekey
Thanks

jonhattan’s picture

Title: get db info for multi database with drush » Make clear that --database option requires a value
Version: 7.x-4.4 »
Assigned: asghar » Unassigned

Committed a fix in aa96404 to this option's documentation to note a value is required. It is not enforced though. See #1416198: Drush should check for missing values for options that require values (e.g. --sites-subdir).

Options:
 --database=<extra>                        The DB connection key if using multiple connections in settings.php.
moshe weitzman’s picture

FYI, drush5 has clearer help about how you pass in option values.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.