534 Posts in 362 Topics by 229 members
|Go to End|
3 August 2012 at 11:55pm
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?
4 August 2012 at 6:33pm
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
5 August 2012 at 3:51am
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?
5 August 2012 at 9:22am
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.
5 August 2012 at 3:27pm
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.
|Go to Top|