Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Error 1558: Column count of mysql table is wrong. Please use mariadb-upgrade

Error Code
SQLSTATE
Error
Description

1558

HY000

ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE

Column count of mysql.%s is wrong. Expected %d, found %d. Created with MariaDB %d, now running %d. Please use mariadb-upgrade to fix this error

Possible Causes and Solutions

The server returns this error when a table in the mysql system database has a different number of columns than the running server expects, and the table was created by an older MariaDB version. The message names the table and both versions, as six-digit version numbers. For example, 110402 is MariaDB 11.4.2:

ERROR 1558 (HY000): Column count of mysql.proc is wrong. Expected 22, found 21. Created with MariaDB 110402, now running 130002. Please use mariadb-upgrade to fix this error

Newer versions change the structure of some system tables, and mariadb-upgrade updates them. The error usually means that this step didn't happen, for example:

  • The server binaries were upgraded, but mariadb-upgrade wasn't run, or it failed.

  • A dump of the mysql database from an older version was restored into a newer server.

To solve the error, run mariadb-upgrade as a user who has all privileges. On many installations, root@localhost uses unix_socket authentication, so run it as sudo mariadb-upgrade, or name another account with --user. If mariadb-upgrade says that the server is already upgraded, add --force. See Upgrading Between Major MariaDB Versions.

If the table was created by the running version and still has the wrong number of columns, the server returns error 1805 instead: Column count of mysql.proc is wrong. Expected 22, found 21. The table is probably corrupted. That usually means that the table was changed by hand or damaged. mariadb-upgrade --force can also repair the structure in that case.

This page is licensed: CC BY-SA / Gnu FDL

Last updated

Was this helpful?