Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

copy data from one server to another?

Status
Not open for further replies.

darwin101

Programmer
Mar 7, 2001
156
US
Hi all

Is is possiable to copy data from Server A (outside of firewall) to Server B(inside firewall) using sql? What I need to do is copy all of the data in tables from Server A to Server B then delete all data on Server A. This needs to happpen like every 5 minutes. Both servers will be v5.

Any advice/pointers/references would be greatly appreciated.
thanks
 
Hi

Never tried in live with MySQL, but the test says this should work in it too :
Code:
mysqldump -B [green][i]database[/i][/green] -u [green][i]user[/i][/green] | mysql -h [green][i]target_machine[/i][/green] -u [green][i]user[/i][/green]
mysql -u [green][i]user[/i][/green] -e 'drop database [green][i]database[/i][/green]'
mysql -u [green][i]user[/i][/green] -e 'create database [green][i]database[/i][/green]'
You can put the above commands in a script and execute the script from [tt]cron[/tt].

Not sure what you mean with mentioning the firewall.

Feherke.
 
You'll need to portforward port 3306 on the firewall from the external_ip to the internal_ip.

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Server A is the external internet web server, Server B is internal (intranet), Not exposed to the internet and behind the firewall. I need to move data from Server A to Server B then delete the data on Server A. This needs to be done all day long.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top