Neat little trick to fix annoying MySQL error

The error:

InnoDB: Error: Column last_update in table “mysql”.”innodb_table_stats” is INT UNSIGNED NOT NULL but should be BINARY(4) NOT NULL (type mismatch)

To fix this problem you could recreate the entire database as outlined in this post or just run:

sudo mysql_upgrade

This command basicly makes sure all databases, tables and their metadata are correct. The name is a little bit misleading as you don’t have to upgrade your installation to use this command and it won’t perform an upgrade either. However, what it does do is essentially re-aligning your databases with the currently running mysql or mariadb version, and is usually ran after an upgrade. Hence the name..

For non-Ubuntu systems you may need to add -u root -p to get admin access.

Source: Stack Exchange (via Luxian’s Notes)

Related stuff

Leave a Reply

Your email address will not be published. Required fields are marked *