Jump to:

546 Posts in 2222 Topics by 237 members

Hosting Requirements

SilverStripe Forums » Hosting Requirements » MySQL Port BUG?

What you need to consider when choosing a hosting provider and plan.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1252 Views
  • n0ne
    Avatar
    Community Member
    18 Posts

    MySQL Port BUG? Link to this post

    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?

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: MySQL Port BUG? Link to this post

    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)

  • n0ne
    Avatar
    Community Member
    18 Posts

    Re: MySQL Port BUG? Link to this post

    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?

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: MySQL Port BUG? Link to this post

    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.

  • n0ne
    Avatar
    Community Member
    18 Posts

    Re: MySQL Port BUG? Link to this post

    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.

  • qlex
    Avatar
    Community Member
    68 Posts

    Re: MySQL Port BUG? Link to this post

    Hey.
    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?

    1252 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.