Webmin hosts on CentOS 7 come with MariaDB 5.5 by default. If you need to upgrade it MariadDB the following guide will help you to do this step-by-step. Prior to start an upgrade MariaDB 5.5 to 10.2 on the Webmin host there will be a few preliminary but very important steps.
Before you do anything make a backup of your current databases:
1 |
mysqldump -u root -p --all-databases > database-backup.sql |
Also make a backup of your /etc/my.cnf
file (you can always get the default one from /usr/share/mysql
).
Now you can stop and uninstall the current mariadb
packages:
1 |
service mysql stop && yum remove mysql* mariadb* && yum clean all |
For whatever reason it also removes postfix
,postgrey
and perl-DBD-MySQL
:
Create a file /etc/yum.repos.d/MariaDB.repo
, copy and paste the code below inside it.
1 |
touch /etc/yum.repos.d/MariaDB.repo |
1 2 3 4 5 |
[mariadb] name = MariaDB baseurl = http://mirror.mariadb.org/yum/10.2.44/centos7-amd64/ gpgkey=https://mirror.mariadb.org/yum/RPM-GPG-KEY-MariaDB gpgcheck=1 |
Save the /etc/yum.repos.d/MariaDB.repo
then install mariadb 10.2:
1 |
yum install MariaDB-server MariaDB-client postfix postgrey perl-DBD-MySQL |
Start the mysql
service:
1 |
service mysql start |
Run the upgrade for databases and tables:
1 |
mysql_upgrade -u root -p |
Restore your my.cnf
you made a backup of or use one of the examples in the directory i mentioned above. (if you happen to use the example, remove the innodb_additional_mem_pool_size
line as it’s no longer being used)
Your mysql
service has now been upgraded to 10.2 without issue. The MySQL area will be able to read the config file.
Now you may have noticed that during the uninstall that postfix
was also uninstalled along with mariadb 5.5. This indeed happened however luckily it created a backup for the main, virtual and master configuration before uninstallation.
Go to your Webmin CP -> Servers -> Postfix Mail Server
It will say that it’s not installed, click the install button for it to reinstall now go back to “Postfix Mail Server” settings and go to “Edit Config Files”
In the dropdown go to main.rpmsave, virtual.rpmsave
and master.rpmsave
and copy/paste each one to their respective default file.
If you also installed dkim-filter, it would have also created a backup file of dkim-filter.conf.rpmsave so just apply the same thing there (i assume there’s not in house editor so you’ll have to restore via ssh).
Congratulations! You have successfully upgraded MariaDB 5.5 to 10.2