Reply
mysql replication with different table names
Old 10-06-2007, 10:13 AM mysql replication with different table names
capetek's Avatar
Extreme Talker

Posts: 229
Location: Massachusetts
Hi there, Im working on a site that has really slow mysql so I want to set up a cron job to just update my local Mysql database once a day from a remote mysql database. The problem is, my local database has different table names then the remote database. Is there a way to make a script that dumps the remote database then allows me to assign which table and column I would like to insert the data into? All the replication scripts I have found require that each table,column be named exactly the same.

Thanks in advance
__________________
Anthony LeBoeuf
Cape-Tek IT Solutions
www.cape-tek.com
Great hosting at affordable pricing!
capetek is offline
Reply With Quote
View Public Profile Visit capetek's homepage!
 
When You Register, These Ads Go Away!
     
Old 10-10-2007, 02:20 PM Re: mysql replication with different table names
SmartBomb's Avatar
Average Talker

Posts: 27
Name: Dave
Why don't you just change the table names so that they match in both databases. Otherwise you can just write a PHP or PERL script to read the mysqldump file and insert into the backup table.
SmartBomb is offline
Reply With Quote
View Public Profile
 
Old 10-19-2007, 10:17 AM Re: mysql replication with different table names
w2i
Average Talker

Posts: 28
mySQL-replikation does not work with different table-names, because each query on the master is done on the slave.
w2i is offline
Reply With Quote
View Public Profile
 
Old 10-22-2007, 08:21 PM Re: mysql replication with different table names
247SiteAlert's Avatar
Average Talker

Posts: 28
Your source file is a .sql file right? Just edit the file to change the names - you may have to create a PHP script to edit the file for you if you want to add some automation to this process.
__________________
Free Website Uptime Monitoring
http://www.247SiteAlert.com
247SiteAlert is offline
Reply With Quote
View Public Profile
 
Old 10-28-2007, 01:50 PM Re: mysql replication with different table names
joder's Avatar
Flipotron

Posts: 6,446
Name: James
Location: In the ocean.
Replication is on the master all transactions are written to a log file which is sent to a file on the slave. The slave then processes those transactions. It normally is done quickly so if the master has a failure, you have all the information on a slave.

Using MySQL native replication, the table names will be the same. If you use a commercial product such as Golden Gate replication, you can have different table names on the master and slave.
joder is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to mysql replication with different table names
 

Thread Tools

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.15073 seconds with 13 queries