Databases 12 min read

MySQL sys Schema ERROR 1356 Bug When Using mysqldump --all-databases and How to Fix It

The article investigates the MySQL 5.7 sys schema ERROR 1356 caused by mysqldump --all-databases dropping mysql.proc, explains why the bug occurs, cites official documentation and bug reports, and provides four practical solutions including mysql_upgrade, separate sys backups, using --databases, and rebuilding from mysql‑sys.

Aikesheng Open Source Community
Aikesheng Open Source Community
Aikesheng Open Source Community
MySQL sys Schema ERROR 1356 Bug When Using mysqldump --all-databases and How to Fix It

Background: while handling a customer's MySQL issue, the sys.processlist view threw ERROR 1356 indicating invalid references.

Common causes were checked: insufficient privileges, missing sys functions/procedures, cross‑version restore, and missing mysql_upgrade . Permissions were fine, but the sys schema functions and procedures were absent.

Further investigation showed that restoring a full backup made with mysqldump --all-databases on MySQL 5.7.x also removed the mysql.proc table, causing the sys schema to lose its routine definitions and produce ERROR 1356, even when the backup and restore were performed on the same version.

Testing across several 5.7 versions confirmed that any dump using the -A (or --all-databases ) option reproduces the problem, while dumping individual databases does not.

The root cause is a bug in MySQL 5.7 where mysqldump (and mysqlpump ) skip the sys schema and drop mysql.proc during a full dump, leaving the sys views unusable.

Official documentation states that the sys schema is not dumped by default; the bug is tracked in MySQL bug reports 86807, 92631, 83259 and was fixed in later releases.

Four practical solutions are presented:

Run mysql_upgrade --upgrade-system-tables --skip-verbose --force to recreate the sys schema.

Backup the sys schema separately and restore it after a full dump.

Use mysqldump --databases (listing each database) instead of --all-databases for a safe full backup.

Recreate the sys schema from the open‑source mysql‑sys repository.

Additional notes: MySQL 8 no longer uses mysql.proc , so the issue does not appear there; the article also includes snippets of the mysqldump source that skip the sys schema.

MySQLbugdatabase backupmysqldumpsys schemaERROR 1356
Aikesheng Open Source Community
Written by

Aikesheng Open Source Community

The Aikesheng Open Source Community provides stable, enterprise‑grade MySQL open‑source tools and services, releases a premium open‑source component each year (1024), and continuously operates and maintains them.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.