0

I'm on Debian Buster and an already seemingly functioning MariaDB 10.4.13 after upgrading from 10.3.22. However, the recommended mysql_upgrade script fails with the following error:

[..]
Phase 4/7: Running 'mysql_fix_privilege_tables'
ERROR 1071 (42000) at line 442: Specified key was too long; max key length is 1000 bytes
FATAL ERROR: Upgrade failed

Now, this question was asked twice on serverfault but sadly without suitable answers. After doing some more research this is probably due to the sum of my primary keys in some mysql core tables (no idea which ones since the error doesn't specify them) might be too long.

My DB seems to be working so far but I would like to debug the situation and don't know how I'd "attack it". I found someone in another mailing list who dropped all the mysql tables and re-imported them from another MariaDB installation but I'm afraid this might break the DB.

Chaeska
  • 51
  • 5
  • If you have a backup, I'd restore it to a separate database, and extract a list of all the indexes on both DB's, so that you can compare them. You may even restore without importing data, you only need the structure. – Gerard H. Pille May 19 '20 at 19:12
  • OK, got'cha. So compare structures and align them between the DBs. – Chaeska May 19 '20 at 21:56
  • Or... `USE mysql; SHOW TABLE STATUS;` – Rick James May 20 '20 at 02:24
  • OK, question is solved. I did exactly like @GerardH.Pille and Rick James suggested. Compared the structures in a freshly installed DB with mine and fixed the deviations. – Chaeska May 21 '20 at 10:42

1 Answers1

0

Problem solved. There were deviations from default in the mysql core tables. I installed a fresh MariaDB instance locally and compared the schemata via

USE mysql; SHOW TABLE STATUS;

and aligned any differences. After that the upgrade script ran fine.

Chaeska
  • 51
  • 5