どうしますか? 以下の選択肢があります: Y か I : パッケージメンテナのバージョンをインストールする N か O : 現在インストールされている自分のバージョンを残す D : 両バージョンの差異を表示する Z : 状況を調査するためにシェルを開始する [t]2022-01-18 08:15:13
$ dpkg -l | egrep "mariadb|mysql" | grep ^i | col | cut -f 1 (中略) ii mariadb-common ii mysql-client-8.0 ii mysql-client-core-8.0 ii mysql-common ii mysql-server ii mysql-server-8.0 ii mysql-server-core-8.0 [t]2022-01-18 08:26:10
/etc/mysql/FROZEN を見ると、
This MySQL or variant installation has entered "frozen mode". Maintainer scripts will avoid making changes or starting the daemon until manually released from this state. See /usr/share/doc/mysql-common/README for general information about this mode. [t]2022-01-18 08:28:25
MariaDB から MySQL へはダウングレードしたみたいになってる。
In this particular case, an incompatible downgrade attempt has been detected. This can be resolved in one of two ways: [t]2022-01-18 08:29:02
1. Change the contents of /var/lib/mysql/ to contain database data that is compatible with the currently installed MySQL or variant daemon version. [t]2022-01-18 08:31:31
やっぱり、ダンプしておいたデータを入れ直すのが良さそうかな・・・
For example: you could restore from a backup. Alternatively you could do a dump using a future version binary and then a restore using the current version binary. [t]2022-01-18 08:32:09
MySQL ダウングレードな方法も。
2. Switch to a MySQL or variant daemon version that is compatible with the data currently in /var/lib/mysql/. For example, if you have attempted a downgrade from mysql-server-5.7 to mysql-server-5.6, you could "apt install mysql-server-5.7" again. [t]2022-01-18 08:33:39
解決したら /etc/mysql/FROZEN シンボリックリンクを削除する必要あり。
Please resolve this situation and only then remove the /etc/mysql/FROZEN symlink. You can then run "dpkg-reconfigure <package>" where <package> should usually be in the form <variant>-server-<version>. [t]2022-01-18 08:34:30
$ sudo systemctl start mysqld Failed to start mysqld.service: Unit mysqld.service not found. [t]2022-01-18 09:16:37
$ dpkg -l | grep mysql | col | cut -f 1 ii mysql-client-8.0 ii mysql-client-core-8.0 ii mysql-common ii mysql-server ii mysql-server-8.0 ii mysql-server-core-8.0 [t]2022-01-18 09:17:51
$ mysql --version mysql Ver 8.0.27-0ubuntu0.21.04.1 for Linux on x86_64 ((Ubuntu)) [t]2022-01-18 09:18:15
もしかして mysqld.service は要らなかった?
$ sudo systemctl status mysql ● mysql.service - MySQL Community Server [t]2022-01-18 09:19:15
そっか、パスワード不要だったか。
$ sudo mysql -u root Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 8 Server version: 8.0.27-0ubuntu0.21.04.1 (Ubuntu) [t]2022-01-18 09:21:17