Hi. I had a weird situation, i tried to run silverstripe using non-default port, and i couldn't connect, only default 3306 worked. I'm wondering is it a some kind of bug? Is there a way to run ss with mysql on different port than the default one?
In 2.* or 3.0? It looks like the 3.0 code doesn't allow you to pass a port number as a configuration option - which seems a bug. Though you should be able to use this in your _ss_environment file (or site custom php.ini) to change the default port
I'm using 3.0.1.
Neither of your suggested solutions of your solutions works. The mysql is on a different server and I don't have access to change the php.ini stuff, and for the _ss_enviroment file it seems that it behaves exactly the same as before (putting the data into the form).
"I couldn't find a database server on 'XXXXXXX:3307': Unknown MySQL server host 'XXXXXXX:3307' (2)"
I also chekd that db is fine using mysql_connect('XXXXX:3307',.....); in external file.
Any other ideas?
the _ss_enviroment file it seems that it behaves exactly the same as before (putting the data into the form).
Make sure then that it is using / reading that code (using a die() or similar) to ensure that your changes are being read.
The only other solution I would suggest is to work on adding port support for the mysqli constructor. (https://github.com/silverstripe/sapphire/blob/3.0/model/MySQLDatabase.php#L56). It seems like server.com:port behaves differently in mysqli than to mysql, hence the need to pass it as a separate port argument.
Yea, You were right, there's additional parameter if you want to use different port in mysqli. Since it's not a big problem I thought that I could fix it and submit the code to You.
have the same problem. Both mysql5.5 and postgresql 8.3 use other ports 3307 and 5433) so i cant install silverstripe.
did anyone made a change to installation script so that this alternative port could be used?
Go to .htaccess and add line => php_value mysqli.default_port 3307
That`s all, worked fine for me.