[Maintain] Changing MySQL port

Dawn Keenan dkeenan at uwaterloo.ca
Thu Oct 11 16:54:04 UTC 2007


Fox, Sam P wrote:
> Hello everyone,
> 
> The mysql instance for maintain on our server is listening on 3307
> rather than the standard port 3306.  I found mention of the database
> connection in lib.php but I don't see an option for port number.  Which
> configuration files do I need to change so that maintain connects on
> 3307?  Here's the line from php.ini that I'm referring to:
> 
> Line 139:
> $dbh = mysql_connect($dbinfo['host'], $dbinfo['username'],
> $dbinfo['password']);

The first parameter of mysql_connect can include an optional port 
number.  I haven't tried it myself lately, but you should be able to 
define your database server as "host = mysqlserver:3307" in the 
[database] section of maintain.cfg.

I discovered through trial and error that using a hyphen as part of your 
database name is a bad idea, as it causes difficult to track connection 
errors.

--Dawn


More information about the maintain mailing list