Updating MYSQL Databases in the production environment


#1

Hi Guys,

We are using ubuntu 14.04 server edition in our production environment. We installed Zabbix 3.0 compiler edition with the Mysql database 5.5.47 version. I wanted to install the updates for our server except zabbix updates.

I listed updates for my server in which we are having few updates related to Mysql like
Mysql-server-core 5.5
Mysql-mysql-client-5.5 -
mysql-client-core-5.5 -
mysql-common
mysql-server
mysql-server-5.5

Even though this Mysql updates comes under same version, i’m having concerns whether i can update them or not.


#2

Hi

You can upgrade by using below commands

#apt-get update

#apt-get upgrade

#apt-get upgrade mysql*

But MySql 5.5 is the default for Ubuntu 14.04. For upgrading MySQL you should configure MySQL repository, if you want to update MySQL-5.5 to for ex MySQL-5.7 you should upgrade to MySQL 5.6 first before upgrading to 5.7.

You can download the repositories from below link

http://dev.mysql.com/downloads/repo/yum/

and for installing repositories follow the below article

http://www.tecmint.com/install-latest-mysql-on-rhel-centos-and-fedora/

after upgrading mysql-5.5.x to 5.6.x using mysql repository 5.6.x, you should disable 5.6.x repository and enable 5.7.x repository for upgrading 5.6.x to 5.7.x

for disabling repo

#sudo software-properties-gtk

by checking and unchicking the boxes you can disable or enable the repo’s

If you have data in your MySql 5.5 database, it should be migrated automatically, even it’s better to make a backup before doing a major upgrade.

#mysqldump --lock-all-tables -u root -p --all-databases > dump.sql

for restoring the data

#mysql -u root -p < dump.sql

#3

So by upgrading Databases won’t affect my server na?


#4

@rahul_36

Being in a production environment is tricky, especially with the level of risk involved. But if you see no need for updating, then keep your old version of MySQL. If you choose to update then remember to backup configuration files and databases.


#5

have you ever upgraded mysql server in production environment


#7

Sure, when you mention backup that means Mysql backup by using the command mysqldump right?


#8

One more option is there instead of upgrading from 5.5 to 5.6 and again 5.6 to 5.7 the best option is make backup and remove the current version if it is not production server and install latest version of mysql i.e, mysql-5.7.x by configuring the repository and restore the backup.

step 1 : take a backup

#mysqldump --lock-all-tables -u root -p --all-databases > dump.sql

step 2 : remove old mysql

sudo apt-get remove mysql-server

sudo apt-get autoremove

step 3 : install new version of mysql

sudo apt-get install mysql-client-5.7 mysql-client-core-5.7
sudo apt-get install mysql-server-5.7

step 4 : restore your data

mysql -u root -p < dump.sql

follow the below link for reference

http://www.tecmint.com/install-latest-mysql-on-rhel-centos-and-fedora/