In my settings.php I have:

$databases['default']['default']['username'] = 'myname';
$databases['default']['default']['password'] = 'mypass';
$databases['default']['default']['host'] = '192.168.1.91:12345';
$databases['default']['default']['database'] = 'mydb';

but attempting a dump results in:
mysqldump: Got error: 2005: Unknown MySQL server host '192.168.1.91:12345' (3) when trying to connect.

CommentFileSizeAuthor
#7 acceptport.patch555 bytesxenophyle

Comments

ceardach’s picture

Are you using Drupal 7? Due to the database changes, the 6.x version won't work with 7.x.

I did try to add a Drupal 7 branch, but then had difficulty managing two branches that were simultaneously sharing a lot of commits. You may be able to get the appropriate D7 db support patch from the git repo.

mrfelton’s picture

No, I'm using Drupal 6. and the Drupal 6 version of dbscripts from git. I had to set $databases['default'] in my setting.php as that is what seemed to be required by dbscripts - it didn't work without it.

ceardach’s picture

In Drupal 6, your settings.php file should have $db_url as a string. What you have above is connection settings for Drupal 7.

If you are using the git repo, are you pointed at the master branch? I was trying to have D7 support, so master is compatible with D7 (based on the idea that a module's HEAD should be compatible with Drupal core's HEAD), while the 6.x-2.x branch is what you will be looking for.

git branch --track 6.x-2.x origin/6.x-2.x
git checkout 6.x-2.x

That should get that branch for you.

mrfelton’s picture

I know my settings.php should have $db_url , and it does!... but I added $databases to get dbscripts to work. I'm sure I checked out from the D6 tree, but maybe not... I'll checkout again following the advice in your previous post tomorrow. Thanks.

mikey_p’s picture

In the DBTNG module I've had good luck using the parse_url function. It will return all the bits including port, url, protocol (i.e. mysl vs. mysqli) password, username and database.

hefox’s picture

Mysql syntax for port and I'm assuming $db['port'] is what'll be returned from parse url?

Using parse url and an foreach loop array to test if something is set, so this should be an easy fix. But ports are a blank subject for me, so if someone could patch and test it would multiple ports, that'd be just grand.

xenophyle’s picture

Status: Active » Needs review
StatusFileSize
new555 bytes

Here is my first patch: it detects the port.