LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-14-2012, 09:48 AM   #1
propertyagent
LQ Newbie
 
Registered: Jun 2012
Posts: 1

Rep: Reputation: 0
Question Transfer data in one of mysql table


Hallo I need a php script to make one of the table in mysql always update among server. I have one server that have continual data entry and need to be transfer to other hosting. any ideas is welcome. thanks
 
Old 06-14-2012, 12:12 PM   #2
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
You need to setup mysql slave replication if you want to implement the correct solution. Otherwise you can setup a cron on the current server to use mysqldump to dump the table, then scp it to the remote server and have a cron on the remote server to import it.

The second solution is not advisable due to table locks, etc. that can cause issues.

Read about replication here: dev.mysql.com/doc/refman/5.1/en/replication-howto.html
 
Old 06-22-2012, 11:20 AM   #3
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
MySQL replication actually isn't that hard to implement, I don't know of another solution.

Here are some third party guides that might help a bit more:

http://www.howtoforge.com/mysql_mast...er_replication -- how to setup master-master where both mysql servers replicate to each other.

http://www.ovaistariq.net/565/settin...on-with-mysql/ -- how to setup master-slave where only one mysql serve replicates to the other.
 
Old 06-22-2012, 11:21 AM   #4
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
If you run into a question along the way let us know and we can point you in the right direction. First thing to do is make sure both servers have mysql installed.
 
Old 06-22-2012, 02:06 PM   #5
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
http://steveswanson.wordpress.com/20...l-mysql-table/
 
Old 06-22-2012, 02:32 PM   #6
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
That's not what hes looking for habitual. Exporting and importing a database manually do not keep the tables in sync. This solution was discussed in my original posting via cron jobs.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Removing Old Table Data From MySQL carlosinfl Linux - Server 1 07-06-2009 10:01 AM
help with mysql command to update data in a table ncsuapex Programming 2 09-30-2008 11:32 AM
mysql - data validation at the table-creation-time prabhatsoni Linux - Software 2 03-24-2006 12:13 AM
why do i get this error when inserting data to a mysql table verbatim Programming 2 06-15-2005 06:12 AM
mysql - transfer data from one table to another?? macinslaw Programming 22 08-20-2004 01:29 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration