Monthly Archives: May 2021

The mysql.session exists but is not correctly configured

One of our MySQL server(5.5.x) crashed but fortunately we have setup the backup of it. I have built the new server with MySQL(5.7.34) and restored the backup on it but when I tried to run any query like creating new user(s) etc got an error something like:

ERROR 1728 (HY000): Cannot load from mysql.db. The table is probably corrupted

This happens due to the schema changes required for different MySQL server versions. The simple fix to this problem recommended by MySQL is to run the mysql_upgrade command from the command line.
mysql_upgrade checks all tables across all databases for incompatibilities with the current version of MySQL. mysql_upgrade also upgrades the system tables so that we can take advantage of new privileges or capabilities that might have been added. It supersedes the older mysql_fix_privilege_tables script, which should no longer be used.

[IMPORTANT NOTE] Before running mysql_upgrade command on production server, it’s always a good practice to take a full backup of all the databases first, just in case something goes wrong.

I tried to run mysql_upgrade command from terminal:

mysql_upgrade -uroot -p

After entering the command, got this error message:

Note: I am not mentioning mysql username and password in the command because I am using .my.cnf configuration

mysql_upgrade will perform a weaker verification. If the result is not equal to 1, then mysql_upgrade cannot be executed.

Read more of this post
%d bloggers like this: