517 Posts in 280 Topics by 221 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 563 Views |
-
MySQL Port BUG?

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?
-
Re: MySQL Port BUG?

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
ini_set("mysqli.default_port", 42)
-
Re: MySQL Port BUG?

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? -
Re: MySQL Port BUG?

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.
-
Re: MySQL Port BUG?

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.
| 563 Views | ||
|
Page:
1
|
Go to Top |


