NI-Lab.

nilog:

← 前の日 2022-01-18 次の日 →
← 一年前 一年後 →
Twitter (2022-01-18)
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
関連するかも情報
やっぱり、ダンプしておいたデータを入れ直すのが良さそうかな・・・

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
結論としては、MariaDB が入っている Ubuntu 21.04 (Hirsute Hippo) にそのまま MySQL をインストールしようとすると、データの互換性が不十分でセットアップが完了しない、と。
[t] 2022-01-18 08:35:39
設定ファイルは残ってるぽい。

$ dpkg -l | egrep "mariadb|mysql" | grep ^r | col | cut -f 1
rc mariadb-client-10.3
rc mariadb-client-10.5
rc mariadb-server-10.3
rc mariadb-server-10.5
[t] 2022-01-18 08:39:58
rc はパッケージ削除されたけど設定ファイルが残っている状態、らしい。

Desired action:
i = Install
r = Remove
p = Purge

Package status:
n = Not-installed
c = Config-files
i = Installed

dpkg-query(1) — dpkg — Debian jessie — Debian Manpages https://manpages.debian.org/jessie/dpkg/dpkg-query.1.en.html
[t] 2022-01-18 08:41:07
$ sudo apt purge mysql-server mariadb-common ってやったけど特定のパッケージしか消えない・・・
[t] 2022-01-18 08:43:54
apt remove のほうがよかったのかな
[t] 2022-01-18 08:44:35
Arrivederci!

$ sudo apt purge mariadb-client-10.3 mariadb-client-10.5 mariadb-server-10.3 mariadb-server-10.5 mysql-client-8.0 mysql-client-core-8.0 mysql-common mysql-server-8.0 mysql-server-core-8.0 https://twitter.com/nilab/status/1483224600318459904/photo/1
Arrivederci!  $ sudo apt purge mariadb-client-10.3 mariadb-client-10.5 mariadb-server-10.3 mariadb-server-10.5 mysql-client-8.0 mysql-client-core-8.0 mysql-common mysql-server-8.0 mysql-server-core-8.0
元の画像を見る
[t] 2022-01-18 08:47:56
あらー(・_・;)

dpkg: 警告: mariadb-server-10.3 の削除中、ディレクトリ '/etc/mysql' が空でないため削除できませんでした
[t] 2022-01-18 08:48:16
パッケージはもうない。

$ dpkg -l | egrep "mariadb|mysql" | wc -l
0
[t] 2022-01-18 08:49:15
ディレクトリ /etc/mysql を削除できなかったのは FROZEN シンボリックリンクが残っていたから。

$ ls /etc/mysql
FROZEN
[t] 2022-01-18 08:50:31
$ sudo rm -rf /etc/mysql/
[t] 2022-01-18 08:51:51
こんなのも残ってた。

dpkg: 警告: mysql-server-core-8.0 の削除中、ディレクトリ '/usr/share/mysql' が空でないため削除できませんでした

$ ls /usr/share/mysql
debian-10.5.flag

削除しちゃおう。

$ sudo rm -rf /usr/share/mysql
[t] 2022-01-18 08:53:09
作業開始から1時間ぐらいかかっているな・・・
[t] 2022-01-18 08:53:39
Ubuntu 21.04 (Hirsute Hippo) に MySQL をインストールする。
[t] 2022-01-18 08:59:04
$ sudo apt install mysql-server
(中略)
以下のパッケージが新たにインストールされます:
(中略)
mecab-ipadic-utf8 mecab-utils mysql-client-8.0 mysql-client-core-8.0 mysql-common mysql-server
mysql-server-8.0 mysql-server-core-8.0
[t] 2022-01-18 08:59:19
あれ、MySQL 管理者パスワードの設定とかなかったっけ・・・するっとインストールされた。STATE が bad になっとる。

$ systemctl list-unit-files | grep mysql
mysql.service enabled enabled
mysqld.service bad enabled
[t] 2022-01-18 09:02:04
えー(;´∀`)

「あ、なんかシンボリックリンクが………。mysql.serviceとかがmariadbを見てる」

CentOS7の自動起動設定でエラーが出た時の対処法 - Qiita https://qiita.com/binthec/items/32c62a8c776ce4aef8ce
[t] 2022-01-18 09:05:35
$ ls -la /etc/systemd/system してみたら /etc/systemd/system/mysqld.service -> /lib/systemd/system/mariadb.service になってた。

$ sudo unlink /etc/systemd/system/mysqld.service
[t] 2022-01-18 09:13:06
2022年01年18日のnilogをすべて表示する

- NI-Lab.
- Mastodon (@nilab@mastodon-japan.net)
- Twitter (@nilab)
- Timelog (@nilab)
- はてなブックマーク (id:nilab)

Web Services by Yahoo! JAPAN