{"id":1049,"date":"2021-08-16T13:07:55","date_gmt":"2021-08-16T13:07:55","guid":{"rendered":"https:\/\/blog.hostinger.io\/support\/2021\/08\/16\/5496540-how-to-change-the-mariadb-version-on-cyberpanel-vps\/"},"modified":"2026-05-08T13:02:29","modified_gmt":"2026-05-08T13:02:29","slug":"5496540-how-to-change-the-mariadb-version-on-cyberpanel-vps","status":"publish","type":"post","link":"https:\/\/www.hostinger.com\/support\/5496540-how-to-change-the-mariadb-version-on-cyberpanel-vps\/","title":{"rendered":"How to Change the MariaDB Version on CyberPanel VPS"},"content":{"rendered":"<p class=\"no-margin\">There might be the case when you need to upgrade or downgrade the MariaDB (MySQL) package on your VPS. For example, when currently installed version on your server is not supported by your website&rsquo;s CMS. <\/p><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">As an example, in the steps below we will cover a downgrade from MariaDB 10.5 to MariaDB 10.4. You can perform an upgrade or downgrade to any other available version by replacing the version number in the SSH commands. <\/p><p class=\"no-margin\">\n<\/p><h2 id=\"h_75c59089aa\">Step 1 &ndash; Back Up Your Databases<\/h2><p class=\"no-margin\">First, connect to your server <b>using SSH<\/b> and check the MySQL <b>password<\/b> using the following command:<\/p><pre><code>cat .db_password<\/code><\/pre><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">This will display the content of the <b>.db_password<\/b> file. Take note of it. Next, create a <b>fresh database backup<\/b>: <\/p><pre><code>mysqldump -u root -p --all-databases &gt; databasedump.sql<\/code><\/pre><p class=\"no-margin\">When asked to enter the password, use the one you retrieved from the <b>.db_password<\/b> file.<\/p><p class=\"no-margin\">\n<\/p><h2 id=\"h_0e0a46b330\">Step 2 &ndash; Remove the Current MariaDB Version<\/h2><p class=\"no-margin\">After creating a backup, you can <b>safely<\/b> <b>remove <\/b>the MariaDB version. <\/p><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">1. <b>Stop <\/b>the MariaDB service:<\/p><pre><code>systemctl stop mariadb<\/code><\/pre><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">2. <b>Uninstall <\/b>MariaDB:<\/p><pre><code>yum remove mariadb mariadb-server<\/code><\/pre><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">3. Remove <b>data and configuration files<\/b> (optional):<\/p><pre><code>rm -rf \/etc\/my.cnf<br>rm -rf \/var\/lib\/mysql<\/code><\/pre><p class=\"no-margin\">\n<\/p><h2 id=\"h_94cfde5d58\">Step 3 &ndash; Install the Required MariaDB Version<\/h2><p class=\"no-margin\">Now, follow these steps to install the upgraded\/downgraded version:<\/p><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">1. <b>Open <\/b>the file using a text editor such as <b>vim<\/b> or <b>nano<\/b>:<\/p><pre><code>vim \/etc\/yum.repos.d\/MariaDB.repo <\/code><\/pre><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">2. <b>Update the file<\/b> to the following content:<\/p><pre><code>[mariadb]<br>name = MariaDB<br>baseurl = http:\/\/yum.mariadb.org\/10.4\/centos7-amd64<br>gpgkey=https:\/\/yum.mariadb.org\/RPM-GPG-KEY-MariaDB <br>gpgcheck=1<\/code><\/pre><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">3. Update the <b>yum cache index<\/b>:<\/p><pre><code>yum makecache fast<\/code><\/pre><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">4. Install the <b>new version:<\/b><\/p><pre><code>yum install MariaDB-server MariaDB-client<\/code><\/pre><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">5. <b>Enable and start <\/b>MariaDB: <\/p><pre><code>systemctl enable mariadb<br>systemctl start mariadb<\/code><\/pre><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">6. Secure <b>MariaDB<\/b>: <\/p><pre><code>mysql_secure_installation<\/code><\/pre><p class=\"no-margin\">Follow the prompts to set a root password and secure the installation. Note that this is the password used to <b>log in to the MariaDB server as a root user<\/b>.<\/p><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">Use the <code>mysql --version<\/code> command to verify that the version of MariaDB has changed:<\/p><p class=\"no-margin\">\n<\/p><div class=\"intercom-container intercom-align-center\"><img decoding=\"async\" src=\"\/support\/wp-content\/uploads\/sites\/55\/2021\/08\/00dcc668-a8a6-4aa0-9795-f4ff0143f43c.jpg\" alt=\"VPS terminal showing mysql --version output for MariaDB 10.4.20 on Linux\" data-media-id=\"4232\"><\/div><h2 id=\"h_5f569f3f87\">Step 4 &ndash; Import Your Databases<\/h2><p class=\"no-margin\">Finally, <b>import <\/b>your database backup: <\/p><p class=\"no-margin\">\n<\/p><pre><code>mysql -u root -p root &lt; databasedump.sql<\/code><\/pre><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">And <b>restart <\/b>MariaDB: <\/p><pre><code>systemctl restart mariadb<\/code><\/pre><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">That&rsquo;s it, your MariaDB version is successfully updated and your databases restored.<\/p><p class=\"no-margin\">\n<\/p><p class=\"no-margin\"><b>Additional Resources<\/b><\/p><ul>\n<li>\n<p class=\"no-margin\"><b><a href=\"https:\/\/mariadb.com\/kb\/en\/upgrading\/\" target=\"_blank\" class=\"intercom-content-link\" rel=\"noopener\">Upgrading MariaDB Official Documentation<\/a><\/b><\/p>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Upgrading and downgrading MariaDB (MySQL) package on CyberPanel VPS<\/p>\n","protected":false},"author":581,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"include_on_kodee":true,"footnotes":""},"categories":[200],"tags":[],"class_list":["post-1049","post","type-post","status-publish","format-standard","hentry","category-cyberpanel-vps"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/support\/5496540-how-to-change-the-mariadb-version-on-cyberpanel-vps\/","default":1},{"locale":"es-ES","link":"https:\/\/www.hostinger.com\/es\/support\/5496540-como-actualizar-degradar-mysql-mariadb-en-vps-en-hostinger\/","default":0},{"locale":"fr-FR","link":"https:\/\/www.hostinger.com\/fr\/support\/5496540-comment-mettre-a-niveau-modifier-mysql-mariadb-sur-un-vps-chez-hostinger\/","default":0},{"locale":"id-ID","link":"https:\/\/www.hostinger.com\/id\/support\/5496540-bagaimana-cara-upgrade-downgrade-mysql-mariadb-di-vps-di-hostinger\/","default":0},{"locale":"pt-PT","link":"https:\/\/www.hostinger.com\/br\/support\/5496540-como-atualizar-ou-voltar-para-a-versao-anterior-do-mysql-mariadb-na-vps-hostinger\/","default":0}],"include_on_kodee":true,"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/1049","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/users\/581"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/comments?post=1049"}],"version-history":[{"count":1,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/1049\/revisions"}],"predecessor-version":[{"id":4234,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/1049\/revisions\/4234"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/media?parent=1049"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/categories?post=1049"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/tags?post=1049"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}