[CentOS 7] Upgrade Mysql 5.5 to 10.2

5 posts / 0 new
Last post
#1 Thu, 08/10/2017 - 00:50
Teranode

[CentOS 7] Upgrade Mysql 5.5 to 10.2

I'm currently utilizing: Nginx + PHP-FPM (7.1.8) + Memcahce + Redis + MariaDb 10.2.7

First before you do anything make a backup of your current database: mysqldump -u root -p --all-databases > database-backup.sql

Next stop and uninstall the current mariadb service:

# service mysql stop

$ yum remove mysql* mariadb*
$ yum clean all

Also make a backup of your etc/my.cnf file before you do this. (you can always get the default one from /usr/share/mysql)

Create a file in /etc/yum.repos.d/MariaDB.repo then copy and paste the code below inside it.

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

Save then install mariadb 10.2: $ yum install MariaDB-server MariaDB-client

then start the mysql service: # service mysql start

then run and upgrade # 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-milter, it would have also created a backup file of dkim-fliter.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)

Wed, 09/27/2017 - 09:12
Eskes

Les isue is this.

nano /etc/yum.repos.d/MariaDB.repo

Post

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

Save

yum update

reboot

Tue, 10/10/2017 - 09:43
Eskes

You migt get problems. the cehck mysql config i webmin. Config modul. Check that it is service mysql start and stop and not service mariadb

Wed, 06/27/2018 - 23:18
oracast

Stupid question. I am seeing the comment from Eskes about simply adding the new repo and doing a yum update but on every other site it talks about uninstalling first and then installing and running upgrade. Any reason why I am reading this and there are no comments here? I have existing databases but Magento 2 requires MariaDB 10 instead of 5.5 on Centos7 so it seems to be a necessary upgrade but I want to do this correctly and efficiently. Thoughts?

Mon, 02/18/2019 - 09:31
Bassem

please can you explain this point :

"in the dropdown go to main.rpmsave, virtual.rpmsave and master.rpmsave and copy/paste each one to their respective default file."

also i don't have this files but i have others like them >> main.cf.rpmsave, virtual and master.cf.rpmsave