Jump to:

558 Posts in 3572 Topics by 244 members

Hosting Requirements

SilverStripe Forums » Hosting Requirements » is it possible to use MySQL database hosted on another ISP from the silverstripe site?

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

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

Page: 1 2
Go to End
Author Topic: 4195 Views
  • supermegaultra
    Avatar
    Community Member
    33 Posts

    is it possible to use MySQL database hosted on another ISP from the silverstripe site? Link to this post

    Hey all,

    Just like the title says, is it possible to connect to a MySQL database which is hosted on a different ISP to the ISP that Silverstripe is hosted on?

    Specifically my mate has his site hosted on one of the new Telecom hosting plans, but they use MSSQL. So was thinking I could connect to the MySQL database that's hosted on my isp!?

    Cheers.

  • Fuzz10
    Avatar
    Community Member
    787 Posts

    Re: is it possible to use MySQL database hosted on another ISP from the silverstripe site? Link to this post

    Doubtful , since the ISP that hosts your database probably does not allow direct connections to the MySQL server.

  • pinkp
    Avatar
    Community Member
    168 Posts

    Re: is it possible to use MySQL database hosted on another ISP from the silverstripe site? Link to this post

    I've done it with loads of sites, you just need to put: mydomain.com
    Rather than localhost in the _config.php file.

    You may also need to allow the connection, on my cpanel on my MySQL host I just added the IP address and domain name from the control panel of my SS host.

    I got stuck with one and the hosting company sorted it for me.
    Need help or better instructions let me know!

  • supermegaultra
    Avatar
    Community Member
    33 Posts

    Re: is it possible to use MySQL database hosted on another ISP from the silverstripe site? Link to this post

    Cheers pinkpoliceman! I had a feeling it must be possible.

    I've asked the hosting company to allow access for the for the websites IP address and domain and have also updated the details in the _config.php, but when installing silverstripe (mydomain.com/silverstripe/install.php) and after re-checking the requirements I am presented with a blank white page that doesn't do anything.

    I'd just like to check that the 'localhost' line I need to change is:

    Director::set_dev_servers(array(
       'localhost',
       '127.0.0.1',
    ));

    Looking forward to your reply! Cheers.

  • pinkp
    Avatar
    Community Member
    168 Posts

    Re: is it possible to use MySQL database hosted on another ISP from the silverstripe site? Link to this post

    hi supermegaultra,

    no not that part here is an example of the _config.php in the mysite folder.

    <?php

    global $project;
    $project = 'mysite';

    global $databaseConfig;
    $databaseConfig = array(
    "type" => "MySQLDatabase",
       "server" => "yourdomain.com",
       "username" => "your_username_for_that_db",
       "password" => "your_password_for_that_user",
       "database" => "your_MySQL_DB",
    );

    // Sites running on the following servers will be
    // run in development mode. See
    // http://doc.silverstripe.com/doku.php?id=devmode
    // for a description of what dev mode does.
    Director::set_dev_servers(array(
       'localhost',
       '127.0.0.1',
    ));

    // This line set's the current theme. More themes can be
    // downloaded from http://www.silverstripe.com/themes/
    SSViewer::set_theme('tutorial');

    //Director::set_environment_type("dev");
    Debug::send_errors_to("me@mydomain.co.uk");

    ?>

    When you installed SS, you should have entered the details as above, (if that corresponds I don't the install screen to look at right now), the part you said just leave as is. Im not sure if you need the 'www.' when you enter the server address I haven't so far.
    This includes some debug stuff which i find helpful.

    Hope that's helpful! let me know if not!

  • supermegaultra
    Avatar
    Community Member
    33 Posts

    Re: is it possible to use MySQL database hosted on another ISP from the silverstripe site? Link to this post

    Thanks again!

    I'm still unable to get Silverstripe to install and connect to the remote MySQL database, but I think it could be something to do with the hosting company not adding the IP address and domain name properly. I will check with them once they're back from holidays.

    Just to double check - the database server name I'm connecting to is 'mysql.designalt.co.nz' and the database name is 'jacksmachinery'. I have connected to this before perfectly using a silverstripe installation that is hosted on the same domain (designalt.co.nz). Perhaps I should make another MySQL database alongside the 'jacksmachinery' one?

    Thoughts? Cheers!

  • pinkp
    Avatar
    Community Member
    168 Posts

    Re: is it possible to use MySQL database hosted on another ISP from the silverstripe site? Link to this post

    Yeah there's no harm in setting up another db.
    When you try and install what message do you get? This could determine whether or not it is even finding the server or the db etc..?

  • supermegaultra
    Avatar
    Community Member
    33 Posts

    Re: is it possible to use MySQL database hosted on another ISP from the silverstripe site? Link to this post

    Ahh no it's not finding the database at all. I've tried 'mysql.designalt.co.nz' along with plain old 'designalt.co.nz' too.

    Error message I recieve is "Can't find the a MySQL server on 'mysql.designalt.co.nz': Unknown MySQL server host 'mysql.designalt.co.nz' (11004)"

    Perhaps I'll wait until I have heard back from the hosting company that looks after the MySQL server and double check that they have the right IP and DNS.

    Cheers!

    4195 Views
Page: 1 2
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.