Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



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

Posts: 229
Location: Massachusetts
Trades: 0
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

Please login or register to view this content. Registration is FREE

Great hosting at affordable pricing!
capetek is offline
Reply With Quote
View Public Profile Visit capetek's homepage!
 
 
Register now for full access!
Old 10-10-2007, 03:20 PM Re: mysql replication with different table names
SmartBomb's Avatar
Average Talker

Posts: 27
Name: Dave
Trades: 0
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.
__________________

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
SmartBomb is offline
Reply With Quote
View Public Profile
 
Old 10-19-2007, 11:17 AM Re: mysql replication with different table names
w2i
Average Talker

Posts: 27
Trades: 0
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, 09:21 PM Re: mysql replication with different table names
247SiteAlert's Avatar
Average Talker

Posts: 28
Trades: 0
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

Please login or register to view this content. Registration is FREE
247SiteAlert is offline
Reply With Quote
View Public Profile
 
Old 10-28-2007, 02:50 PM Re: mysql replication with different table names
joder's Avatar
Flipotron

Posts: 6,442
Name: James
Location: In the ocean.
Trades: 0
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 Search this Thread
Search this Thread:

Advanced Search

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 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.43766 seconds with 12 queries