Connecting External Server To Local Database

Welcome. Please Login, Register, Or Activate! 
type your username and password to login
Date: November 24, 2009, 03:58 AM
431608 members and 298631 Topics
Latest Member: Mariano17
Nairaland [Nigerian Forum] Home Help Search Who is currently online? Login Register
Nairaland Forum  |  Technology  |  Webmasters (Moderators: OmniPotens, yawa-ti-de)  |  Connecting External Server To Local Database
Pages: (1) Go Down Send this topic Notify of replies
Author Topic: Connecting External Server To Local Database  (Read 1301 views)
cmon (m)
Connecting External Server To Local Database
« on: April 16, 2008, 02:36 PM »

I'm just a website developer (well you can say a new one  Grin). When I get web projects, I usually do the hosting on external servers. Now a client wants to run a database on his system (Connected to the internet) and be able to synchronize the database on his local server (computer system) with the one on his website. How do I accomplish that?

Here's my point:

I'm of fan of the popular XAMPP software. Even if I install the XAMPP on his local system, how do I get to synchronize the database system (MySQL) with that of his website or how do I get the website to use the database on his local system using PHP, enabling real-time contents of the database to reflect on the website?
syskay (m)
Re: Connecting External Server To Local Database
« #1 on: April 16, 2008, 02:43 PM »

This can be implemented by using the "Remote Mysql" feature.
cmon (m)
Re: Connecting External Server To Local Database
« #2 on: April 16, 2008, 02:57 PM »

go on  Huh
syskay (m)
Re: Connecting External Server To Local Database
« #3 on: April 16, 2008, 03:27 PM »

Since you are going to be accessing the database of your website remotely, you will need to set the appropriate host access permissions in the "Remote Mysql" section. You can then go ahead to install and configure your database synchronization application.
cmon (m)
Re: Connecting External Server To Local Database
« #4 on: April 16, 2008, 03:43 PM »

so where's the file? remember I'm using XAMPP. If you can, you can just direct my using a url to where I can get the resource I need.
smartsoft (m)
Re: Connecting External Server To Local Database
« #5 on: April 16, 2008, 03:54 PM »

What i understand on what you want is that your local server is installed, and u want to link an external database you have created together with that you have on your website. Huh because i do n't really understand that part !
Kobojunkie
Re: Connecting External Server To Local Database
« #6 on: April 17, 2008, 11:11 AM »

If what you want to do is sync the two databases,  then check this out  http://www.databasejournal.com/features/mysql/article.php/1584401

[url]http://lists.mysql.com/mysql/49
[/url]

If however, you want to sort of backup the contents of the local to the remote, then I suggest you, maybe use a trigger to have the remote server get updated each time a change is made to the local database. Problem is in my opinion, this is a really bad idea. So how about you connect your app directly to the remote database so that changes are made available in the DB as soon as your client makes the change to the same Database and then he can always back up the remote database to his local machine like once a day.
uspry1 (f)
Re: Connecting External Server To Local Database
« #7 on: April 17, 2008, 11:59 AM »

There are three ways you can do MySQL remote/local synchronization for your client working on your web project at below:

1.) You could use MySQL replication, with your laptop as a replication client. Each time you connect your laptop will pull all changes to your tables since the last time you connected.

The replication is about zero writes on the slave. It is used where you expect a slave to do nothing. Of course, you can use replication to get the source data into one database on your local server, then copy the data to a working schema using INSERT ,  SELECT queries and only make changes on the working schema.

2.) Under the website development contract where it is shown the agreeing with you and your client to furnish client's hosting server login system (username/password) to access the client's remote MySQL server, you can copy the data from your local server  to remoted working schema using INSERT, SELECT queries and modify the working schema.

3.) You register the web-based remote access such as "GoToMyPC" (link: https://www.gotomypc.com/) or set up using Windows XP/Vista's  "Remote Assistance" with Windows Live Messenger (formerly MSN Messenger) that allowing you to access remoted client's computer system to open client's local server to replicate source data into client's MySQL using INSERT, SELECT queries and modifying the working schema. Be sure you and your client must have Windows Live Messenger login on. Google how to use Windows' Remote Assistance or check with your  Windows XP/Vista Help and Support.

It is usually for remote web developer for foreigner/remote client in the distance without driving or meeting in person.

** If you are LINUX OS, then I am bit rusty to answer MySQL remote/local synchronization with LINUX. . .it would be different LINUX syntax. I used to be familiarized with LINUX debian-based OS in the past. **
uspry1 (f)
Re: Connecting External Server To Local Database
« #8 on: April 17, 2008, 12:09 PM »

The most of time I deal with my clients working on MySQL database, I do replicate all my source data from my local server (not client's local server) to be copied into my client's remote MySQL server with client's hosting server username/password access according to my/client's website development agreement/contract.

Of course I code INSERT, SELECT on MySQL queries to modify the working schema in quality of database functionally the exactly the same as my local server.

I have no problem with that!

I used to have "GOTOMYPC" remote access to client's computer system in the distance only for COMPUTER REPAIR such as Virus attack, software upgrades, etc. as well as pick up document/pictures/external files need for my design project ONLY WITH CLIENT'S PERMISSION. Because my client is CLUELESS about computer, do not know nothing about it!

I terminated "GOTOMYPC", because it cost money per month!!!
Kobojunkie
Re: Connecting External Server To Local Database
« #9 on: April 17, 2008, 12:10 PM »

Check out LOGINME.com ,  it is free
uspry1 (f)
Re: Connecting External Server To Local Database
« #10 on: April 17, 2008, 12:14 PM »

Quote from: Kobojunkie on April 17, 2008, 12:10 PM
Check out LOGINME.com , it is free

@kobojunkie

It prompts saying service discontinued.
Kobojunkie
Re: Connecting External Server To Local Database
« #11 on: April 17, 2008, 12:15 PM »

mambenanje (m)
Re: Connecting External Server To Local Database
« #12 on: April 17, 2008, 12:44 PM »

@cmon
 if I get you clearly you want your web application to read a local mysql instance hosted on your clients computer. it means you have to convert your clients computer into a web server.
 All you need to do is make your clients computer have a PUBLIC IP ADDRESS, then you can login to the mysql on his computer by using the public IP address as the server host.
 from there all what you want is possible, you can host the whole application within the clients computer and it will still serve the world. But one thing is that the clients computer must be on 24/7 which I dont think is possible in Africa
 hope it helps
Abidemi_A
Re: Connecting External Server To Local Database
« #13 on: April 18, 2008, 10:58 AM »

@mambenanje,

I hv been following your contributions  on this forum. I will like us to talk one on one. my contact is info@adten.net
mcneal
Re: Connecting External Server To Local Database
« #14 on: April 18, 2008, 06:33 PM »

>> Using Windows:

You can place the command below in a batch script, and use the "at" command or Windows task scheduler to execute it at intervals.

Code:
\ , \xampp\mysql\bin\mysqldump --create-options -u [local_db_user] -p [local_db_password] -h localhost --add-drop-table [name_of_local_database] | \ ,  \xampp\mysql\bin\mysql -h [remote_MySQL_hostname_OR_IP_address] -u [remote_db_user] -p [remote_db_password] [name_of_remote_database]

N.B
"\ ,  \" - Replace with full path to where your XAMPP was installed, e.g F:\Program Files\
Values in squared-brackets "[]" are to be replaced with appropriate values and without the "[]".
Host on both sides (ISP & Web host) must allow remote access to MySQL port (default 3306)
You might need to allow remote access to your online (webhosts) DB - can be done using phpMyAdmin or host's control panel.

Loads of possible command line switches is available at http://dev.mysql.com/doc/refman/5.0/en/mysqldump.html

Other refs: http://www.sitepoint.com/article/backing-up-mysqldump/2 (read Method 3)

You can also use the replication option, but you most likely will need to be in control of of the remote server as well.

>> Real-time Access

If your client have a public IP, enable TCP access to MySQL port (default 3306) from your webhost, grant access privilege to database user that will be connecting remotely, point your PHP app to connect to clients public IP and you should be fine.
Hope this helps
mambenanje (m)
Re: Connecting External Server To Local Database
« #15 on: April 20, 2008, 01:51 AM »

@Abidemi_A
 I am happy to read your request and I will get to you soon when I catch some time
 Creating The Ultimate Discussion Forum  Guideline/Roadmap For New Web Designers (Contains Detailed Description)  Set Record Straight: Pinkequity, Pinkbloomer, Deltavag, & Inspiredautos  Page 2
Pages: (1) Go Up Send Topic to Friend by E-mail Reply 


Sections: Autos/Cars (2) Jobs/Vacancies (2) (3) Career Talk Education General(2) Politics Romance Computers Phones Travel
Sports Fashion Health Religion Celebrities TV/Movies (2) Music/Radio (2) Books Webmasters Programming

Links: Page1 Page2 Page3 Page4 Page5 Page6 Page7 Page8 Page9 Page10

Nairaland is owned by Oluwaseun Osewa. See also: Nairalist Classified Ads
Nairaland Forum | Powered by SMF 1.0.12.
© 2001-2005, Lewis Media. All Rights Reserved.