/var/log/mysql/error.log見てたら
2024-05-13 17:20:29 85 [Warning] InnoDB: Table mysql/innodb_index_stats has length mismatch in the column name table_name. Please run mysql_upgrade
ってのがたくさんあったので
# mysql_upgrade
したら
Reading datadir from the MariaDB server failed. Got the following error when executing the 'mysql' command line client ERROR 2019 (00000): Can't initialize character set utf8_general_ci (path: compiled_in)
って言われた。んー、接続時の文字コードがいかんのかなって思って
# mysql_upgrade -u root -p --default_character_set=utf8
ってやったらうまくいった。
めでたい。エラーも出なくなった。