garvinhicking wrote:Hi!
Which PHP version and mysql client library are you using?
php5 -v
PHP 5.1.2 (cli) (built: Mar 7 2007 21:53:56)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
apt-cache show php5-mysqli
Package: php5-mysqli
Priority: optional
Section: web
Installed-Size: 160
Maintainer: Debian PHP Maintainers <
pkg-php-maint@lists.alioth.debian.org>
Architecture: i386
Source: php5
Version: 5.1.2-1ubuntu3.6
garvinhicking wrote:
Entering the DBhost as "db.host.com:3307" should work. If you are running a DB server on db.host.com and it works there when you enter "db.host.com" try to enter "db.host.com:3306" to see if it generally works.
It might be your mysql server is only running using Sockets and not ports, and thus the connection fails.
According to the docs on mysql_connect() on
www.php.net, specifying the port after the hostname is correct. If you are running an old PHP version or old MySQL client libs this might be different for you.
It would seem that way, but apparently when that host/port string is being passed to the driver, it's not seeing it as two separate things, because this is the error I get back on the admin page:
Code: Select all
Could not connect to database; check your settings.
The mySQL error was: Unknown MySQL server host 'db.host.com:3307' (1)
It's not a "can't connect" message, it can't even find the server. If I take out the ":3307" it comes back with it an access denied message because it hits the MySQL 4 serer which doesn't have the s9y user.
According to the mysqli docs, the host and port are two separate entities:
Procedural style
mysqli mysqli_connect ( [string $host [, string $username [, string $passwd [, string $dbname [, int $port [, string $socket]]]]]] )
Object oriented style (constructor):
class mysqli {
__construct ( [string $host [, string $username [, string $passwd [, string $dbname [, int $port [, string $socket]]]]]] )
}
port
Specifies the port number to attempt to connect to the MySQL server.
In the mysql extension, the port number can be part of host name. So, I guess my "problem" is that I was trying to use the mysqli extension, and s9y isn't coded to use a custom port when using mysqli. I guess I'll use the mysql extension. I didn't assume there would be any difference either, so in my original post, I never wrote about the fact that I was using mysqli. Sorry if that created unnecessary confusion.