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
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

ceardach - April 15, 2009 - 16:14

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

mrfelton - April 15, 2009 - 16:21

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

ceardach - April 15, 2009 - 18:10

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.

#4

mrfelton - April 15, 2009 - 18:29

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

mikey_p - July 2, 2009 - 20:54

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.

 
 

Drupal is a registered trademark of Dries Buytaert.