View Full Version : Beginner DB question...
binomonkey
03-11-2008, 11:57 AM
Hey there,
I'm trying to view a local DB remotely. So, I created a DB through the Hostmonster CP and changed my connection.php script to reflect the extra "name_" before the DB. By the way, the DB is the same name as that on my local machine. So, it looks like that part works fine but I'm still not able to access my tables within the DB. So, the next thing I did is import the table from my local DB to my remote one and that seems to work. However, I don't think I have done things right because basically I now have set up a remote DB by doing this. Could someone please help out?
Cheers and thanks
McCoy
03-11-2008, 12:44 PM
What you just did, is to make a copy of your database online. But of course, it's not synched with your local database.
If you want a website to access your local database, you need to change your connection.php settings so the server addres will be your internet public IP (check it out at www.whatismyip.com). If you connect to the internet with a dynamic IP, you'll have to change that every time your IP changes (depending on your ISP, it can be everytime you connect to the internet, or every 3 days, one week...), or use a IP alias service like DynDNS or No-IP.
If you're behind a router in your home, you will have to re-route the MySQL ports to the computer having your MySQL server with the database.
binomonkey
03-11-2008, 01:06 PM
Thanks for the response...I'll look into it just now.
Another question though...what are the benefits to having a local or remote database?
Cheers
shadmego
03-11-2008, 02:08 PM
I think you are getting confused on the terminology a bit.
"local" and "remote" are relative terms. If you are talking about starting out on your website, and if that site is hosting on HM servers, then the "local" database will be on the same server your website is on. This, in relation to your desktop will be "remote".
If you are talking about starting out at your desktop, then both your website, again hosted on HM servers and the database will be remote, as it relates to your current location.
Taking this into consideration, it will always be best to have the website, AND the database hosted on the same server. Speed, availability and other security factors will play into the reasons why.
If your database and website are not hosted on the same server, then they will be remote as they relate to each other. An example will be if your website is on HM servers, and your database is on your desktop, then the website will be remote compared to your database, and local compared to your physical location. On the other hand, the website will be remote to your physical location and local as it relates to the server the site is hosted on.
If you have a set up where the database and website are hosted on physically different servers, then you will be at the mercy of the availabilty and uptime of the Internet to keep your site running. If any hop between the database and web servers goes down, then your site, visitors, and profits suffer.
I hope I didn't help to confuse you more ...
~regards
binomonkey
03-13-2008, 02:25 AM
Your explanation helps lots.
Cheers
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.