0

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 ?

2
  • 2
    Going from one obsolete version to another obsolete version isn't a good approach. MySQL 5.6 reaches End-of-Life in February 2021. As for speed, MySQL Enterprise and real backups are 80 times faster than scripting (dumps are scripts, not backups). Backups are online too, which means you don't have to stop the server to take a backup Jul 21, 2020 at 16:40
  • If you want to minimise downtime, you will need another server, so you can safely test your migratin. Also, I don't think you came to the right site with this question, since this is not a programming question, this is database admin one. I would move this question over to the dba sister site of SO.
    – Shadow
    Jul 21, 2020 at 16:54

1 Answer 1

1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.