Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Upgrading SilverStripe /

Ask questions about upgrading SilverStripe to the latest version.

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

Accessing remote MySQL database


Go to End


5 Posts   2350 Views

Avatar
thepleb

Community Member, 22 Posts

10 December 2014 at 12:58am

Hi there, I am moving over to a hosted MySQL database, before putting my website on to a hosted platform.

I have the server IP, username, password and database. I have restored the database from my local instance. I have re-pointed the config file to the new server location and tried to do a /dev/build, but I get a generic server error.

After a little investigation I have found that to connect to the database I need to include the auth_type = 'config' parameter. I have tied to include it, but it makes no difference. Can I just add:

"auth_type" => 'config',

to the mysite/_config.php file?

Avatar
camfindlay

Forum Moderator, 267 Posts

22 December 2014 at 10:18am

Have you checked to see if there are any firewall rules in place on either of the web server or the database server that is blocking the two from talking to each other?

Avatar
thepleb

Community Member, 22 Posts

23 December 2014 at 11:03pm

The CMS is currently on my machine, and I am able to connect to it with MySQL Workbench, with that setting enabled.

Our network doesn't restrict outbound communication, so that should be fine.

Avatar
camfindlay

Forum Moderator, 267 Posts

24 December 2014 at 11:32am

auth_type from a quick search seems to be a setting for phpmyadmin (a mysql admin gui tool). Is the intended use here to have a completely separate mysql database server and web server once you get to production OR are you trying to run your local development version from the remote mysql on the same server as the production webserver so that later on you'll already have the data in place?

If the DB server and the webserver have a high ping (have to send requests across a long route to get a response) you might have performance issues while developing locally if I have make the correct assumptions above.

Suggestion would be to develop everything locally on local infrastructure and then look into some tools to transfer the database when ready to go live.

I've been using "sspak" a useful tool for exactly this https://github.com/silverstripe/sspak there was also a tool called replicant too https://github.com/GOVTNZ/replicant

Avatar
thepleb

Community Member, 22 Posts

24 December 2014 at 9:36pm

Edited: 24/12/2014 9:38pm

Yes I was going to move the database onto the new hosted server, so that the data is already there ready for moving the system up to the server. I am currently working on a local installation. The hosted solution has the WWW on one server and the database on a completely different one.

So do you think, when I upload the files to the server the database link should just start working. I suppose I could send it up to a sub domain for now just to check and see what happens...