can not use port other than default (3306)
mrfelton - April 15, 2009 - 09:08
| Project: | Database Scripts |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
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.

#1
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.
#2
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.
#3
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.xgit checkout 6.x-2.x
That should get that branch for you.
#4
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.
#5
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.