# Mysqldump: Error 1412: Table definition has changed

**URL:** <https://forums.percona.com/t/mysqldump-error-1412-table-definition-has-changed/32169>\
**Category:** Percona Server for MySQL 8.0\
**Created:** [August 9, 2024, 10:15am UTC](https://forums.percona.com/t/mysqldump-error-1412-table-definition-has-changed/32169 "2024-08-09T10:15:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hossain\_Mahmud](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/hossain_mahmud/32/17617_2.png) [@Hossain\_Mahmud](https://forums.percona.com/u/Hossain_Mahmud)\
**Post date:** [August 9, 2024, 10:15am UTC](https://forums.percona.com/t/mysqldump-error-1412-table-definition-has-changed/32169/1 "2024-08-09T10:15:00Z")

</div>

Hi,

I’m running Percona Server 8.0 on Kubernetes with StatefulSets. When I try to back up a database using `mysqldump` 8.0.21:

> mysqldump --set-gtid-purged=OFF --single-transaction \<db\_name\>

I get this error:

> mysqldump: Error 1412: Table definition has changed, please retry transaction when dumping table \<table\_name\> at row: 0

Any advice on how to fix this?

Thanks!

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [August 9, 2024, 2:50pm UTC](https://forums.percona.com/t/mysqldump-error-1412-table-definition-has-changed/32169/2 "2024-08-09T14:50:40Z")

</div>

Hello @Hossain_Mahmud,  
Yes, the advice is don’t do any ALTER TABLE while a backup is in progress. You need to increase the locking level of mysqldump to prevent any ALTER TABLE from happening while the backup is running.

---

<div class="post-metadata">

**Author:** ![Hossain\_Mahmud](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/hossain_mahmud/32/17617_2.png) [@Hossain\_Mahmud](https://forums.percona.com/u/Hossain_Mahmud)\
**Post date:** [August 15, 2024, 11:59am UTC](https://forums.percona.com/t/mysqldump-error-1412-table-definition-has-changed/32169/4 "2024-08-15T11:59:58Z")

</div>

> [@matthewb](#):
>
> Yes, the advice is don’t do any ALTER TABLE while a backup is in progress. You need to increase the locking level of mysqldump to prevent any ALTER TABLE from happening while the backup is running.

Thanks. Just to clarify, when you mention increasing the locking level, are you suggesting using flags like `--lock-tables` or `--lock-all-tables` with the mysqldump command?

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [August 15, 2024, 12:42pm UTC](https://forums.percona.com/t/mysqldump-error-1412-table-definition-has-changed/32169/5 "2024-08-15T12:42:25Z")

</div>

@Hossain_Mahmud,  
Yes, try with those increased locking levels. If it works with those, then you know things are still modifying while the backup is happening when using less levels.
