Just upgraded my server machine from freebsd 11.4 to freebsd 12.4.
Then ungraded the installed packages, in particular mysql57-server.
The server is started from a particular user account.
When I try to run mysql_upgrade, I get this:
Checking if update is needed.
Checking server version.
Running queries to upgrade MySQL server.
Checking system database.
mysql.columns_priv OK
...
The sys schema is already up to date (version 1.5.2).
Checking databases.
Error occurred: Error during call to mysql_check.
I've tried various permutations of the mysql_update command and server start command as described here.
In trying to narrow this down, I've done:
mysqlcheck --all-databases --check-upgrade --auto-repair
mysqlcheck: Got error: 1049: Unknown database 'mytestdb' when selecting the database
The "unknown database" above is in a directory named "MyTestDB", so there is a naming issue relative to the file system.
If I run mysqlcheck on a known table with a "good name" I see:
mysqlcheck --check-upgrade my_known_db
my_known_db.my_table1
error : Table rebuild required. Please do "ALTER TABLE `my_table1` FORCE" or dump/reload to fix it!
my_known_db.landing
So it appears that the issue is the database directory name.
Where are the database names stored? I don't see them in the mysql or sys databases, at least not in the tables I've looked in. Assuming I know that, can this problem be corrected by simply changing the database name to match the directory name?
The directory may have been renamed some time ago, but has not been used since then; not sure and don't have a backup to look at handy.