I use a specific port number for a connection over SSH tunnel. On PHP side, instead of using host=localhost, I use host=127.0.0.1:3307
In include/dblayer/functions_mysqli.inc.php I had to change the code this way to make it work:
if (strpos($host, ':') !== false) { list($host, $port) = explode(':', $host); } else { $port = null; } $mysqli = new mysqli($host, $user, $password, null, $port);
We could also have a simpler code and an optional $conf['db_port'] = 3307; in database.inc.php
I think it will be a problem if we try to have this work and also [Forum, post 141385 by fisharebest in topic 21661] v2.5 upgrade script fails due to lack of support for mysql sockets
mistic100 (and others) what is your opinion?
Offline
that's why I asked for the various syntaxes possible :)
I would prefer to find a way to automate it
Offline
Two ideas :
1) - add an optional port (with a default value)
- add an optional socket support
2) use a data source name (DSN) for advanced user.
http://pear.php.net/manual/fr/package.d … ro-dsn.php
The idea is to allow advanced people to use their specific installation and describe it in a standard way. And the other idea is to let less advanced people to give database informations as easy as possible.
The two solutions involve a modification of the installation web step. We can imagine that the surnumeral fileds can be hidden by default and a checkbox show them with a label "advanced users"
My 2 cents.
Offline
mistic100 wrote:
I would prefer to find a way to automate it
I agree, no need to change install screen for 0.001% of users.
host = /path/to/socket => substr($host, 0, 1)=='/'
host = 1.2.3.4:3405 => port 3405
host = localhost
Offline