Database credentials: connect to a non-standard MySQL port

Permalink
Hello,

I'd like C5 to connect to a MySQL server which runs on a non-standard port. How would I do that? I've tried config/site.php:

define('DB_SERVER', 'localhost:3333');

It seems that the colon and everything after it is ignored. I can even write 'localhost:HELLO' and it connects to port 3306.

After that I've thought about hacking the core (not nice, I know). In concrete/libraries/loader.php around line 195..200 I've tried adding '?port=3333' to both variants of $dsn string according to some AdoDB manual I found, still with no luck.

Thanks for any enlightenment in this case,
Alex

 
LX666 replied on at Permalink Reply
Addendum: I managed to enforce the right port through php.ini's mysql.default_port setting. That works, but is a little to harsh - it may have an impact on other PHP/MySQL driven services at the same machine, in case there is more then one MySQL server to connect to.
jbx replied on at Permalink Reply
jbx
Hey,

you'll be pleased to know that there's actually a really easy way to do this.

define('DB_DATABASE', 'dbname?port=3333');

strange but true :)

Jon
Pawelk replied on at Permalink Reply
How Can I change mysql port ? When i try to install Concrete5 i have message "SQLSTATE[HY000] [2005] Unknown MySQL server host 'http://**********' (90)"

Which file i need to edit ?
akworob replied on at Permalink Reply
set host name to
example.com;port=3307