Recently, we had to upgrade a MariaDB server from version 10.5.4 to 10.5.13. Before to do the upgrade on a production server, I wanted to test it on a personal VM.
But first, I had to find how to install the specific version 10.5.4 of MariaDB. Today, I’m going to explain how to install a specific version of MariaDB and how to upgrade it to an other specific version.
I’ll now explain how to install MariaDB server version 10.5.4. The first step is to download the MariaDB script to configure access to their MariaDB Package Repositories :
wget https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
Note that you can add some parameters when you pull the file, like –mariadb-server-version=<version> that will override the default MariaDB Server version.
Example :
curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | sudo bash -s -- --mariadb-server-version="mariadb-10.6"
Then don’t forget to give the execution right to the script you just downloaded.
chmod +x mariadb_repo_setup
If you didn’t mention the MariaDB version when downloading the script, now is the time to change it to choose the MariaDB version you want to install. You can find all the different packages available here at MariaDB repository configuration tool : https://downloads.mariadb.org/
Use this command to edit the script :
./mariadb_repo_setup --mariadb-server-version="mariadb-10.5.4"
You can now install the MariaDB server. I used yum install as I was working on a Redhat VM.
sudo yum install mariadb-server mariadb-backup
After the installation, have a look if it was properly installed (by listing all the installed package) and if the mysql service is running. If it’s not running, try to start it.
apt list --installed|grep-i mariadb systemctl status mysql systemctl start mysql
You can also try to connect to MariaDB server to check its version.
mysql
Now, let’s see how to upgrade the version of an installed MariaDB server.
First, you have to remove all the packages concerning MariaDB.
yum remove "mariadb-*"
Then you simply have to repeat the steps that we’ve seen above.
./mariadb_repo_setup --mariadb-server-version="mariadb-10.5.13" yum install -y mariadb-server mariadb-backup systemctl status mysql systemctl start mysql mysql
You can find all the information on MariaDB Package Repository Setup and Usage at the following link :
https://mariadb.com/kb/en/mariadb-package-repository-setup-and-usage
not_applicable
18.09.2024Followed this to downgrade to 10.5.26. I can't start mariadb.service due to [ERROR] InnoDB: Unsupported redo log format.
[root@jbidevlin03 maridabupgrade]# systemctl start mariadb.service
Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xeu mariadb.service" for details.
[root@jbidevlin03 maridabupgrade]# systemctl status mysql
× mariadb.service - MariaDB 10.5.26 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; preset: disabled)
Drop-In: /etc/systemd/system/mariadb.service.d
└─migrated-from-my.cnf-settings.conf
Active: failed (Result: exit-code) since Wed 2024-09-18 09:25:07 ACST; 26s ago
Docs: man:mariadbd(8)
https://mariadb.com/kb/en/library/systemd/
Process: 2161917 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 2161918 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] && systemctl set-environment _WSREP_START_POSITION=$V>
Process: 2161926 ExecStart=/usr/sbin/mariadbd $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
Main PID: 2161926 (code=exited, status=1/FAILURE)
Status: "MariaDB server is down"
CPU: 86ms
Sep 18 09:25:07 jbidevlin03.services.adelaide.edu.au mariadbd[2161926]: 2024-09-18 9:25:07 0 [ERROR] InnoDB: Unsupported redo log format. The redo log was created with MariaDB 11.5.2.
Sep 18 09:25:07 jbidevlin03.services.adelaide.edu.au mariadbd[2161926]: 2024-09-18 9:25:07 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
Sep 18 09:25:07 jbidevlin03.services.adelaide.edu.au mariadbd[2161926]: 2024-09-18 9:25:07 0 [Note] InnoDB: Starting shutdown...
Sep 18 09:25:07 jbidevlin03.services.adelaide.edu.au mariadbd[2161926]: 2024-09-18 9:25:07 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
Sep 18 09:25:07 jbidevlin03.services.adelaide.edu.au mariadbd[2161926]: 2024-09-18 9:25:07 0 [Note] Plugin 'FEEDBACK' is disabled.
Sep 18 09:25:07 jbidevlin03.services.adelaide.edu.au mariadbd[2161926]: 2024-09-18 9:25:07 0 [ERROR] Unknown/unsupported storage engine: InnoDB
Sep 18 09:25:07 jbidevlin03.services.adelaide.edu.au mariadbd[2161926]: 2024-09-18 9:25:07 0 [ERROR] Aborting
Sep 18 09:25:07 jbidevlin03.services.adelaide.edu.au systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Sep 18 09:25:07 jbidevlin03.services.adelaide.edu.au systemd[1]: mariadb.service: Failed with result 'exit-code'.
Sep 18 09:25:07 jbidevlin03.services.adelaide.edu.au systemd[1]: Failed to start MariaDB 10.5.26 database server.
[root@jbidevlin03 maridabupgrade]# systemctl start mysql
Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xeu mariadb.service" for details.
Regards,
Mike
Joan Frey
18.09.2024Hi Mike,
Effectively, a lot of things changed between version 10 and 11 and you should usually not downgrade.
The issue you're encountering after trying to downgrade to version 10.5.26 seems to come after it had previously created InnoDB redo logs in MariaDB 11.5.2.
The older version of MariaDB (10.5.26) cannot read these redo logs, which is causing the error.
To solve the issue, I'd try to revert to MariaDB 11.5.2 or to delete the redo log file before starting MariaDB service (backup these files before deleting them).
I can't guarantee the result thought.
Joan