Error "mysqldump: Couldn't execute 'SHOW PACKAGE STATUS..."
Error "mysqldump: Couldn't execute 'SHOW PACKAGE STATUS WHERE Db = '[...]'': You have an error in your SQL syntax [...] (1064)" when backing up MySQL
This error can occur if you are using a version of mysqldump
from MariaDB 10.3 prior to July 2019, connecting to an older MySQL database.
This version of mysqldump
does not correctly limit itself to the remote server's capabilities.
For instance, this issue can occur with the defalt mysqldump in Debian Buster 10.0.
You can read more about this issue on the MariaDB bug tracker:
- https://jira.mariadb.org/browse/MDEV-17429
- https://github.com/MariaDB/server/commit/620f4f8af98666e2efb7e14fb26
- https://github.com/dbeaver/dbeaver/issues/6086
Workaround
You can work around this issue by disabling backup of stored procedures.
If this is acceptable, you can perform this workaround by stripping the --routines
parameter that Magnus Box passes to mysqldump
. To do so on Linux,
- Create a file with the following content:
#!/bin/bash # This program is a wrapper for mysqldump that removes the --routines argument, # to work around issue MDEV-17429 with older MySQL servers args=("$@") for ((i=0; i<"${#args[@]}"; ++i)); do case ${args[i]} in --routines) unset args[i]; break;; esac done /usr/bin/mysqldump "${args[@]}"
- Save this file as
/opt/productname/mysqldump-no-routines
- Mark the file as executable:
chmod +x /opt/productname/mysqldump-no-routines
- In the Protected Item settings, set "custom mysqldump path" to this file