If I use code from db_operations, I will have to adjust the code from db_operations (which should not be difficult), but I will also have to modify PMA_Table::moveCopy a lot, because they are using methods of $GLOBALS['pma']. What is good about PMA_Table::moveCopy is that it will also copy views, however it won't copy triggers for me.
That's why, I'm still playing with idea of using Zahraa's code for synchronization databases - the code is already prepared for multiple servers and I think it will provide what I need - simple copy structure and/or data from one server to another. Unfortunately, the last code from Zahraa, which I found is from midterm. Zahraa - could you please update your SVN repositary?
Modifying existing code will allow me to use a bit more complex copy tool, but I'm not really sure, if it is possible to modify the code in a way, that it can work with external/another mysql server. In all cases, the best way to copy data from master to slave would be by using mysqldump command.
Any suggestions about loading data from master to slave before replication is started are more than welcomed.
Thank you.
Best Regads,
Tomas
Marc Delisle wrote:
Tomas Srnka a écrit :
Hello,
I've been working on my design for managing slave replication and I've run into a problem.
To explain, slave replication works in a way, that it loads master log (located on master server), where information about transactions are stored. Everything is fine, if you are setting up replication on empty server. However, once you have some data on master, you have to copy them to slave server before slave replication is started. My original idea was to use LOAD DATA FROM MASTER, but this feature is no longer supported (http://dev.mysql.com/doc/refman/5.0/en/load-data-from-master.html). One of my ideas is to create some sort of export/import function for copying data from master to slave with phpMyAdmin. Another possibility (for large databases/tables) is to ask root (=user) to do it manually (with mysqldump+mysql client).
If anyone has any better idea how to solve this problem, please let me know.
Thank you.
Tomas
Tomas, in phpMyAdmin, if you click on a database name then Operations, we have a dialog "Copy database"; the functions that are called might help you.