TransWikia.com

How to upgrade Mysql 5.5 to 5.6 without data loss on aws-ec2?

Database Administrators Asked by Palash Jadhav on November 11, 2021

MySQL server (5.5) is running on aws-ec2 instance with following linux details

NAME="Amazon Linux AMI"
VERSION="2015.09"
ID="amzn"
ID_LIKE="rhel fedora"
VERSION_ID="2015.09"
PRETTY_NAME="Amazon Linux AMI 2015.09"
ANSI_COLOR="0;33"
CPE_NAME="cpe:/o:amazon:linux:2015.09:ga"
HOME_URL="http://aws.amazon.com/amazon-linux-ami/"

Since Django 2.2 doesn’t support Mysql 5.5
https://docs.djangoproject.com/en/2.2/ref/databases/#mysql-notes
. I want to upgrade MSQL to 5.6 .

  • We don’t have backup server and we don’t want new server .
  • Creating sql dump , removing MySQL 5.5 then installing MySQL 5.6 and importing dump will it work ? Since server has 100 GB of data importing the dump will be a long process and we will have considerable amount of downtime .There can be some issue with data while importing dump in 5.6 .

Is there a way to upgrade MySQL without data loss and less downtime ?

One Answer

You don't need to dump and import the databases, a copy of the folder /var/lib/mysql should be ok for backup.

I suggest you upgrade to MySQL 5.7 as its the currently supported release and has better performance,

here are the steps, I implemented it many times with no issues

1. # service mysql stop
  1. backup your databases before the upgrade

    $ cp /var/lib/mysql /var/lib/mysql.original

  2. Download the MySQL 5.7 RPM

    $ wget http://repo.mysql.com/mysql57-community-release-el7.rpm -P /tmp/

  3. Remove the MySQL-Community RPM that contains MySQL 5.5

    $ yum remove mysql-community-release

  4. Install the MySQL 5.7 RPM

    $ rpm -ivh /tmp/mysql57-community-release-el7.rpm

  5. Update the MySQL Repository to 5.7

    $ yum update mysql

  6. Let MySQL know that it received an upgrade

    service mysql start

    mysql_upgrade

Answered by AWS PS on November 11, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP