[MariaDB] A manual upgrade is required
아래는 CentOS 7에서 예전에 쓰던 MariaDB(10.11.8)를 깨끗이 지우지 않고 dnf로 11.4.2판으로 곧바로 판올림하려다가 막힌 모습이다.
[user@host ~]# sudo dnf update
MariaDB Tools 0.0 B/s | 0 B 00:00
MariaDB Server 251 kB/s | 384 kB 00:01
MariaDB MaxScale 0.0 B/s | 0 B 00:00
Dependencies resolved.
=======================================================================================
Package Arch Version Repository Size
=======================================================================================
Upgrading:
MariaDB-client x86_64 11.4.2-1.el7.centos mariadb-main 17 M
MariaDB-common x86_64 11.4.2-1.el7.centos mariadb-main 82 k
MariaDB-compat x86_64 11.4.2-1.el7.centos mariadb-main 2.2 M
MariaDB-server x86_64 11.4.2-1.el7.centos mariadb-main 27 M
Installing dependencies:
MariaDB-client-compat noarch 11.4.2-1.el7.centos mariadb-main 7.9 k
MariaDB-server-compat noarch 11.4.2-1.el7.centos mariadb-main 5.5 k
Transaction Summary
=======================================================================================
Install 2 Packages
Upgrade 4 Packages
Total download size: 46 M
Is this ok [y/N]: y
Downloading Packages:
(1/6): MariaDB-client-compat-11.4.2-1.el7.centos.noarc 9.7 kB/s | 7.9 kB 00:00
(2/6): MariaDB-server-compat-11.4.2-1.el7.centos.noarc 5.0 kB/s | 5.5 kB 00:01
(3/6): MariaDB-common-11.4.2-1.el7.centos.x86_64.rpm 94 kB/s | 82 kB 00:00
(4/6): MariaDB-client-11.4.2-1.el7.centos.x86_64.rpm 7.3 MB/s | 17 MB 00:02
(5/6): MariaDB-compat-11.4.2-1.el7.centos.x86_64.rpm 1.4 MB/s | 2.2 MB 00:01
(6/6): MariaDB-server-11.4.2-1.el7.centos.x86_64.rpm 7.7 MB/s | 27 MB 00:03
---------------------------------------------------------------------------------------
Total 8.8 MB/s | 46 MB 00:05
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Running scriptlet: MariaDB-compat-11.4.2-1.el7.centos.x86_64 1/10
Upgrading : MariaDB-compat-11.4.2-1.el7.centos.x86_64 1/10
Running scriptlet: MariaDB-compat-11.4.2-1.el7.centos.x86_64 1/10
Running scriptlet: MariaDB-common-11.4.2-1.el7.centos.x86_64 2/10
Upgrading : MariaDB-common-11.4.2-1.el7.centos.x86_64 2/10
Running scriptlet: MariaDB-common-11.4.2-1.el7.centos.x86_64 2/10
Running scriptlet: MariaDB-client-11.4.2-1.el7.centos.x86_64 3/10
Upgrading : MariaDB-client-11.4.2-1.el7.centos.x86_64 3/10
Running scriptlet: MariaDB-client-11.4.2-1.el7.centos.x86_64 3/10
Running scriptlet: MariaDB-client-compat-11.4.2-1.el7.centos.noarch 4/10
Installing : MariaDB-client-compat-11.4.2-1.el7.centos.noarch 4/10
Running scriptlet: MariaDB-client-compat-11.4.2-1.el7.centos.noarch 4/10
Running scriptlet: MariaDB-server-compat-11.4.2-1.el7.centos.noarch 5/10
Installing : MariaDB-server-compat-11.4.2-1.el7.centos.noarch 5/10
Running scriptlet: MariaDB-server-compat-11.4.2-1.el7.centos.noarch 5/10
Running scriptlet: MariaDB-server-11.4.2-1.el7.centos.x86_64 6/10
******************************************************************
A MySQL or MariaDB server package (MariaDB-server-10.11.8-1.el7.centos.x86_64) is installed.
Upgrading directly from MySQL 10 to MariaDB 11 may not
be safe in all cases. A manual dump and restore using mysqldump is
recommended. It is important to review the MariaDB manual's Upgrading
section for version-specific incompatibilities.
A manual upgrade is required.
- Ensure that you have a complete, working backup of your data and my.cnf
files
- Shut down the MySQL server cleanly
- Remove the existing MySQL packages. Usually this command will
list the packages you should remove:
rpm -qa | grep -i '^mysql-'
You may choose to use 'rpm --nodeps -ev ' to remove
the package which contains the mysqlclient shared library. The
library will be reinstalled by the MariaDB-shared package.
- Install the new MariaDB packages supplied by MariaDB Foundation
- Ensure that the MariaDB server is started
- Run the 'mysql_upgrade' program
This is a brief description of the upgrade process. Important details
can be found in the MariaDB manual, in the Upgrading section.
******************************************************************
error: %pre(MariaDB-server-11.4.2-1.el7.centos.x86_64) scriptlet failed, exit status 1
Error in PREIN scriptlet in rpm package MariaDB-server
Running scriptlet: MariaDB-client-10.11.8-1.el7.centos.x86_64 7/10
error: MariaDB-server-11.4.2-1.el7.centos.x86_64: install failed
error: MariaDB-server-10.11.8-1.el7.centos.x86_64: erase skipped
Cleanup : MariaDB-client-10.11.8-1.el7.centos.x86_64 7/10
Running scriptlet: MariaDB-client-10.11.8-1.el7.centos.x86_64 7/10
Running scriptlet: MariaDB-compat-10.11.8-1.el7.centos.x86_64 8/10
Cleanup : MariaDB-compat-10.11.8-1.el7.centos.x86_64 8/10
Running scriptlet: MariaDB-compat-10.11.8-1.el7.centos.x86_64 8/10
Running scriptlet: MariaDB-common-10.11.8-1.el7.centos.x86_64 9/10
Cleanup : MariaDB-common-10.11.8-1.el7.centos.x86_64 9/10
Running scriptlet: MariaDB-common-10.11.8-1.el7.centos.x86_64 9/10
Verifying : MariaDB-client-compat-11.4.2-1.el7.centos.noarch 1/10
Verifying : MariaDB-server-compat-11.4.2-1.el7.centos.noarch 2/10
Verifying : MariaDB-client-11.4.2-1.el7.centos.x86_64 3/10
Verifying : MariaDB-client-10.11.8-1.el7.centos.x86_64 4/10
Verifying : MariaDB-common-11.4.2-1.el7.centos.x86_64 5/10
Verifying : MariaDB-common-10.11.8-1.el7.centos.x86_64 6/10
Verifying : MariaDB-compat-11.4.2-1.el7.centos.x86_64 7/10
Verifying : MariaDB-compat-10.11.8-1.el7.centos.x86_64 8/10
Verifying : MariaDB-server-11.4.2-1.el7.centos.x86_64 9/10
Verifying : MariaDB-server-10.11.8-1.el7.centos.x86_64 10/10
Upgraded:
MariaDB-client-11.4.2-1.el7.centos.x86_64 MariaDB-common-11.4.2-1.el7.centos.x86_64
MariaDB-compat-11.4.2-1.el7.centos.x86_64
Installed:
MariaDB-client-compat-11.4.2-1.el7.centos.noarch
MariaDB-server-compat-11.4.2-1.el7.centos.noarch
Failed:
MariaDB-server-11.4.2-1.el7.centos.x86_64 MariaDB-server-10.11.8-1.el7.centos.x86_64
Error: Transaction failed
다른 요소들은 판올림하여 깔 수 있었지만, MariaDB-server-11.4.2-1는 깔지 못하고 실패했다.
mariadb가 제대로 깔리지 않은 상태였기 때문인지, 아래처럼 단순히 mysql_upgrade를 실행하는 것은 보람이 없었다.
[user@host ~]# sudo mysql_upgrade
Reading datadir from the MariaDB server failed. Got the following error when executing the 'mysql' command line client
ERROR 2026 (HY000): TLS/SSL error: SSL is required, but the server does not support it
FATAL ERROR: Upgrade failed
또한 아래처럼 dnf update를 실행하더라도 MariaDB-server-11.4.2-1이 깔리지 않는다.
[user@host ~]# sudo dnf update
Last metadata expiration check: 0:02:32 ago on Thu 20 Jun 2024 11:40:06 PM KST.
Dependencies resolved.
=======================================================================================
Package Arch Version Repository Size
=======================================================================================
Upgrading:
MariaDB-server x86_64 11.4.2-1.el7.centos mariadb-main 27 M
Transaction Summary
=======================================================================================
Upgrade 1 Package
Total download size: 27 M
Is this ok [y/N]: y
Downloading Packages:
MariaDB-server-11.4.2-1.el7.centos.x86_64.rpm 11 MB/s | 27 MB 00:02
---------------------------------------------------------------------------------------
Total 10 MB/s | 27 MB 00:02
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Running scriptlet: MariaDB-server-11.4.2-1.el7.centos.x86_64 1/2
******************************************************************
A MySQL or MariaDB server package (MariaDB-server-10.11.8-1.el7.centos.x86_64) is installed.
Upgrading directly from MySQL 10 to MariaDB 11 may not
be safe in all cases. A manual dump and restore using mysqldump is
recommended. It is important to review the MariaDB manual's Upgrading
section for version-specific incompatibilities.
A manual upgrade is required.
- Ensure that you have a complete, working backup of your data and my.cnf
files
- Shut down the MySQL server cleanly
- Remove the existing MySQL packages. Usually this command will
list the packages you should remove:
rpm -qa | grep -i '^mysql-'
You may choose to use 'rpm --nodeps -ev ' to remove
the package which contains the mysqlclient shared library. The
library will be reinstalled by the MariaDB-shared package.
- Install the new MariaDB packages supplied by MariaDB Foundation
- Ensure that the MariaDB server is started
- Run the 'mysql_upgrade' program
This is a brief description of the upgrade process. Important details
can be found in the MariaDB manual, in the Upgrading section.
******************************************************************
error: %pre(MariaDB-server-11.4.2-1.el7.centos.x86_64) scriptlet failed, exit status 1
Error in PREIN scriptlet in rpm package MariaDB-server
Verifying : MariaDB-server-11.4.2-1.el7.centos.x86_64 1/2
Verifying : MariaDB-server-10.11.8-1.el7.centos.x86_64 2/2
Failed:
MariaDB-server-11.4.2-1.el7.centos.x86_64 MariaDB-server-10.11.8-1.el7.centos.x86_64
Error: Transaction failed
dnf 로 MariaDB-server(10.11.8-1)를 지우는 것도 아래처럼 막히고 있다.
[user@host ~]# sudo dnf remove MariaDB-server
Dependencies resolved.
=======================================================================================
Package Arch Version Repository Size
=======================================================================================
Removing:
MariaDB-server x86_64 10.11.8-1.el7.centos @mariadb-main 141 M
Transaction Summary
=======================================================================================
Remove 1 Package
Freed space: 141 M
Is this ok [y/N]: y
Running transaction check
Error: transaction check vs depsolve:
MariaDB-server >= 11.0.0 is needed by (installed) MariaDB-server-compat-11.4.2-1.el7.centos.noarch
To diagnose the problem, try running: 'rpm -Va --nofiles --nodigest'.
You probably have corrupted RPMDB, running 'rpm --rebuilddb' might fix the issue.
rpm 명령으로 mariadb가 들어가는 깔린 꾸러미(패키지)들이 무엇인지 알아 본다.
[user@host ~]# sudo rpm -qa | grep -i "^mariadb"
MariaDB-compat-11.4.2-1.el7.centos.x86_64
MariaDB-client-compat-11.4.2-1.el7.centos.noarch
MariaDB-common-11.4.2-1.el7.centos.x86_64
MariaDB-server-compat-11.4.2-1.el7.centos.noarch
MariaDB-server-10.11.8-1.el7.centos.x86_64
MariaDB-client-11.4.2-1.el7.centos.x86_64
앞에서 dnf를 실행했을 때에 나온 설명을 참고하여, 아래처럼 rpm 명령으로 MariaDB-server-10.11.8-1.el7.centos.x86_64을 지운다.
[user@host ~]# sudo rpm --nodeps -ev MariaDB-server-10.11.8-1.el7.centos.x86_64
Preparing packages...
MariaDB-server-10.11.8-1.el7.centos.x86_64
이렇게 하면 MariaDB-server가 깔리지 않은 상태가 되므로, 아래처럼 MariaDB-server를 새로 깔 수 있다.
[user@host ~]# sudo dnf install MariaDB-server
Last metadata expiration check: 0:05:54 ago on Thu 20 Jun 2024 11:40:06 PM KST.
Dependencies resolved.
=======================================================================================
Package Arch Version Repository Size
=======================================================================================
Installing:
MariaDB-server x86_64 11.4.2-1.el7.centos mariadb-main 27 M
Transaction Summary
=======================================================================================
Install 1 Package
Total download size: 27 M
Installed size: 137 M
Is this ok [y/N]: y
Downloading Packages:
MariaDB-server-11.4.2-1.el7.centos.x86_64.rpm 9.8 MB/s | 27 MB 00:02
---------------------------------------------------------------------------------------
Total 9.8 MB/s | 27 MB 00:02
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Running scriptlet: MariaDB-server-11.4.2-1.el7.centos.x86_64 1/1
Installing : MariaDB-server-11.4.2-1.el7.centos.x86_64 1/1
Running scriptlet: MariaDB-server-11.4.2-1.el7.centos.x86_64 1/1
Verifying : MariaDB-server-11.4.2-1.el7.centos.x86_64 1/1
Installed:
MariaDB-server-11.4.2-1.el7.centos.x86_64
Complete!
덧글을 달아 주세요