Richard Reina via discuss <[email protected]> writes: > I have a stable replication environment set up with a MySQL master (that > will be retired next quarter) and Mariadb replicas. I need to restore a > mysql table from a back up. If I stop mysql with 'systemctl stop mysql' > replace the table_name.MYD, table_name.MYI and table_name.frm with their > corresponding backup files and restart mysql will the mariadb replica > servers update correctly?
No, this will not work. The slave(s) will not see the changes to the table done by copying the table files. There are different ways to achieve what you need. One way for example is to make the rows in the restored table visible to the slave using row-based replication. After replacing the table_name.* files and restarting the MySQL master, run something like this to re-populate the table on the SQL level: SET SESSION binlog_format=ROW; CREATE TABLE tmp_table LIKE table_name; INSERT INTO tmp_table SELECT * FROM table_name; DELETE FROM table_name; INSERT INTO table_name SELECT * FROM tmp_table; DROP TABLE tmp_table; (Assuming the table_name table is not too huge to make this practical, if it is at most a few GB then it should be fine). By using ROW mode, the INSERT-SELECT statements will send the new, restored data to the slave, and the table will get replicated correctly. - Kristian. _______________________________________________ discuss mailing list -- [email protected] To unsubscribe send an email to [email protected]
