Reputation: 19
I am trying to recover my slave cluster. I have followed the guide instructions from here: How to re-sync the Mysql DB if Master and slave have different database incase of Mysql replication?
The dump from the master has been taken using the following command:
mysqldump --all-databases --single-transaction --add-drop-table --master-data=2 --flush-logs > /mnt/sqlbackup/mysqldump.sql
I have reset the slave. At the state of importing the dump, I encountered the following error:
ERROR 1180 (HY000) at line XXXXX1268: Got error 1 "Operation not permitted" during COMMIT
The dump is huge, and I have used the awk command to find what is exactly on that line of the dump. I found the following instruction:
--
-- Dumping data for table `d_xxxx_yyy`
--
LOCK TABLES `d_xxxx_yyy` WRITE;
/*!40xxx ALTER TABLE `d_xxxx_yyy` DISABLE KEYS */;
INSERT INTO `d_xxxx_yyy` VALUES
The exactly line XXXXX1268 from the error message is INSERT INTO `d_xxxx_yyy` VALUES
The version of mysql on my server is:
Server version: 10.7.3-MariaDB-1:10.7.3+maria~focal-log mariadb.org binary distribution
How can I import the dump to restore the Slave?
Upvotes: -1
Views: 2615
Reputation: 31
I had the same problem, among the SQL generated by mysqldump command, the order of the columns in the INSERT statement was not correct.
I was able to work around it by adding the mysqldump -c
option to INSERT by column.
Upvotes: 1