I am working with the same Database on two different computers, and need to keep them synchronized.
When I finish working on one computer I create a dump file of the Database at that point so I can import it in the other with the instruction:
mysqldump -u username -p DataBaseName TableName > Table.dump
My problem is that when I insert elements in some tables it may happen that their primary key is already assigned to an element of the same table of the Database on my other computer.
I would like to know how to insert the instructions I found in the question How can I merge two MySQL tables? in the dump files I create, in order to assign new primary key values to the duplicate entries, without loosing the data of the table.
I would like to avoid the behavior of the created dump file, that will entirely drop previous version of the interested table, as quoted below:
DROP TABLE IF EXISTS `TableName`;
CREATE TABLE `TableName` (
...
) ENGINE=MyISAM AUTO_INCREMENT=6512 DEFAULT CHARSET=utf8;