MariaDB - ERROR Incorrect definition of table

  • Last update: Apr 3, 2024
  • Views: 22
  • Author: Admin
MariaDB - ERROR Incorrect definition of table

Colleagues hello to all.

In today's article, we'll talk about a common mistake that happens in MariaDB.

 

After updating the database, the following error may occur in the log files:

[ERROR] Incorrect definition of table mysql.column_stats: expected column 'hist_type' at position 11 to have type enum('SINGLE_PREC_HB','DOUBLE_PREC_HB','JSON_HB'), found type enum('SINGLE_PREC_HB','DOUBLE_PREC_HB').
[ERROR] Incorrect definition of table mysql.column_stats: expected column 'histogram' at position 12 to have type longblob, found type varbinary(255).

This error doesn't occur very often, but sometimes it happens, namely at the moment when you updated the database.

Sometimes it even happens that after such an error your database may not start, then there are no more options left, but only restore the database from the last backup.

 

To solve this problem, you need to run the  mysql_upgrade utility.

$. mysql_upgrade -u root -p

 

If you have upgraded a database version from 10.4.6, the utility will be called mariadb-upgrade.

$. mariadb-upgrade -u root -p

 

The utility must be run on a running database. You need to run the utility from the account that has administrative rights. The utility is a tool that checks and upgrades your tables to the latest version. 

Before starting, it is recommended to backup all databases.

The utility will check all system tables and update them to the latest version, it takes a couple of seconds.


 

Thank you all, I hope that my article helped you in some way.

 

SIMILAR ARTICLES