简体   繁体   中英

MySQL Replication/alternate

Basically I am into Development side of things PHP and SQL . Currently I am working with a project which may need a MYSQL Replication features. Below mentioned are some of my Requirements and just wondering if any one can provide their expert suggestions and Tips in case if this is the right solution according to my needs with relevant documentation, links or steps to get this done .

Requirements :

Master database - Live website database Slave Database -Development database both of these are on 2 different server and slightly version of both of them differ a bit.

Questions to clarify:

1 I want all the data from the Master database to replicate on slave .while the database structure of slave database will be same like master (sql dump) but I have plans of adding few more tables and column field to slave database. Do Replication still work if the structure of slave database differs from Master . I mean with all columns of Master being present on slave database along with additional columns and Tables ?

2 Also the database version .Does this Replication work with versions of databases .

3 What is the Risk Level . As I am trying to replicate the Live websites database into a development database .Incase if anything goes wrong during configuration or during development phase will my Master database be corrupted or will it be down as a result of any failure.I am looking for a more secure approach with zero risk tolerance.

4 Any other Options available to get this done . Links to any documentations . Any third party tools like Navcat sqllog ?

I found this Doc . Not sure if this is the best one or any other better documents or blogs covering this in details . https://dev.mysql.com/doc/refman/5.0/en/replication-howto.html

Thanks for any help !

Yes, it is technically possible. See http://dev.mysql.com/doc/refman/5.5/en/replication-features-differing-tables.html

However, you can imagine this will be an administrative headache. An intermediate solution might be to have a database design where all tables in master have the exact same schema on the slave, and you isolate any extras into their own tables. It will also be good if you can avoid foreign keys between these two sets of tables and perform any kind of joins at runtime, in your database client code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM