News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Hosting a database remotely

Started by bros, September 30, 2010, 04:57:21 PM

Previous topic - Next topic

bros

I have a question - I am wondering if it is possible to host the database on a VPS, then have the files on my shared hosting?

If so, how would I do it? I have already tried modifying settings.php to this:

...
########## Database Info ##########
$db_type = 'mysql';
$db_server = 'IP OF VPS';
$db_name = 'SMF_TEST';
$db_user = 'user';
$db_passwd = 'password';
$ssi_db_user = '';
$ssi_db_passwd = '';
$db_prefix = 'smf_';
$db_persist = 0;
$db_error_send = 0;
...

IchBin™

And what was your result?

A lot of hosts use separate database servers. By default most servers don't allow access to mysql through a firewall as well as the mysql configuration though. Have you checked those settings on your VPS?
IchBin™        TinyPortal

bros

Ah, true. I should check my SQL settings in apache.

The result was:
Connection Problems

Sorry, SMF was unable to connect to the database. This may be caused by the server being busy. Please try again later.

I'll modify the settings and post results

rd

Please keep in mind that hosting providers use high end servers to host databases in, like 16 GB RAM with fast drives, RAID, and other configurations, also they have the sever in the same datacenter, usually connected by 1 GB port. Keep in mind that distance might be an issue, you might get connection timeouts and such.

bros

Figured it out - Edited my.cnf from:
bind-address = localhost

to

bind-address = IP OF SERVER

And it worked. It was a good test of a remote hosting. Although because of the VPS being in the US and the shared hosting being in england, there was a bit of a delay, but not as much as I was expecting (Only around 2 seconds to create a page)

Advertisement: