In this guide, we will explain how to upgrade or downgrade MariaDB MySQL package on CyberPanel VPS. In following case, we need to downgrade MariaDB from 10.5 to 10.4 because at the moment writing this article Magento doesn't support MariaDB 10.5.

Before you upgrade, it would be best to take a backup of your database. This is always a good idea to do before an upgrade.

Steps:

  1. Check the Cyberpanel and root Mysql passwords: cat .db_password

  2. Take a backup of the Cyberpanel database:
    mysqldump -u root -p --all-databases > databasedump.sql (use the password in the .db_password file)

  3. Remove MariaDB 10.5:

  4. Add MariaDB YUM repository: vim /etc/yum.repos.d/MariaDB.repo and update the file to:

    [mariadb]
    name = MariaDB
    baseurl = http://yum.mariadb.org/10.4/centos7-amd64
    gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1

  5. Update yum cache index: yum makecache fast

  6. Install Mariadb 10.4: yum install MariaDB-server MariaDB-client

  7. Enable and start mariadb: systemctl start mariadb and systemctl enable mariadb

  8. Secure MariaDB: mysql_secure_installation Use the same password in .db_password. Mariadb 10.4 should now be running, check with mysql --v

    image
  9. Import the databases: mysql -u root -p root < databasedump.sql

  10. Restart MariaDB: systemctl restart mariadb

    MariaDB upgrading documentation

Did this answer your question?