SELECT PARTITIONNAME, TABLENAME FROM informationschema.partitions WHERE TABLESCHEMA = 'yourdatabasename';
Replace `yourdatabasename` with the name of your database.
SELECT TABLENAME, COLUMNNAME, CONSTRAINTNAME, REFERENCEDTABLENAME, REFERENCEDCOLUMN_NAME
FROM informationschema.KEYCOLUMN_USAGE
WHERE REFERENCEDTABLESCHEMA = 'yourdatabasename';
SHOW ENGINE INNODB STATUS;
Look under the `TRANSACTIONS` section for transactions that might be using the partition.
SET FOREIGNKEYCHECKS=0;
-- Your DROP PARTITION command here
SET FOREIGNKEYCHECKS=1;
Be sure to replace `-- Your DROP PARTITION command here` with your actual `DROP PARTITION` command.
ALTER TABLE yourtablename DROP PARTITION partition_name;
Replace `yourtablename` with the name of your table and `partition_name` with the name of the partition you wish to drop.
(Perfect for DevOps & SREs)
(Perfect for DevOps & SREs)



