I got this error when I tried to use pt-Osc some of the solutions I am thinking about is to drop the foreign key and recreate it later.
DBD::Mysql::db do failed: cannot delete or update a parent row : a foreign key constraint fails for statements. Here I’m trying to use the pt-online schema change and I have tried all the available options, using this tool. Any suggestions
Hello @Dba1,
It would be helpful if you provided some output, and the command used, and the error you see. Also, the schema of the table will help. There is an option in pt-osc to drop FKs, and then recreate them after the ALTER is complete. Did you try that?
Ah. I didn’t realize this was MariaDB; you didn’t mention that above. Good catch! You can switch to Percona Server MySQL as a drop-in replacement (provided you have no Aria tables) to gain this feature.