upgrade mysql 5.1->5.7 (CentOS 6)

first, upgrade from 5.1 to 5.5 https://support.plesk.com/hc/en-us/articles/213367429

 

  • Install the Atomicorp repository:

    wget -q -O – http://www.atomicorp.com/installers/atomic | sh

  • Upgrade MySQL:

    yum upgrade mysql

 

 

  • Restart the MySQL service:

    service mysqld restart

  • Upgrade MySQL databases:

    mysql_upgrade -uadmin -p`cat /etc/psa/.psa.shadow`

  • In case the message below appears, refer to the KB article Error during yum upgrade: Packages excluded due to repository protections:

    yum upgrade mysql
    ….
    881 packages excluded due to repository protections
    No Packages marked for Update

 

Next, update from 5.5->5.7 https://support.plesk.com/hc/en-us/articles/213403429-How-to-upgrade-MySQL-5-5-to-5-6-5-7-or-MariaDB-5-5-to-10-0-10-1-10-2-on-Linux

  1. Stop the MySQL service:

    # service mysqld stop

  2. Create a backup of databases:

    # cp -a /var/lib/mysql /var/lib/mysql_backup

    Note: Disable Atomic repository, if it is enabled:

    # vi /etc/yum.repos.d/atomic.repo
    enabled = 0

  3. Install the MySQL-community repository:

    # yum install https://dev.mysql.com/get/mysql80-community-release-el6-1.noarch.rpm

  4. Select a MySQL version:

    # vi /etc/yum.repos.d/mysql-community.repo
    [mysql56-community]
    enabled=0
    [mysql57-community]
    enabled=1

  5. Install MySQL packages:

    # yum update mysql

    If update of mysql package ends with Nothing to do message, make sure that mysql* packages are not added to excludes in yum.conf file and remove it if it is in the list:

    # cat /etc/yum.conf | grep exclude
    exclude=php-common php-cli php mysql* httpd* mod_ssl*

  6. Type y if this message appears:

    warning: rpmts_HdrFromFdno: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
    Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
    Importing GPG key 0x5072E1F5:
    Userid : MySQL Release Engineering <mysql-build@oss.oracle.com>
    Package: mysql57-community-release-el6-7.noarch (@/mysql57-community-release-el6-7.noarch)
    From : /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
    Is this ok [y/N]:

  7. Start the MySQL service:

    # service mysqld start

    If the service does not start, check the following article: MySQL fails to start: mysql.user table is damaged.

  8. Upgrade MySQL databases:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql_upgrade -uadmin

  9. Restart mysql service:

    # service mysqld restart

 

Posted in Uncategorized.