How to upgrade MySQL 5.5 to 5.6/5.7 or MariaDB 5.5 to 10.0/10.1/10.2 on Linux?

Follow

Comments

123 comments

  • Avatar
    Aptum Frontline

    Can you please make  sure that the step "mysql_upgrade" is added after upgrading / starting MySQL on the CentOS 7 instructions? 

    This checks and fixes any system tables

    Thank You

    1
    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    Hello @Cogeco Peer 1 Frontline,

    I have reviewed the article, "mysql_upgrade" is already added to be executed after upgrading Database server and starting it.

     

    0
    Comment actions Permalink
  • Avatar
    Signor Rossi

     Upgraded to MariaDB 10.3 on Plesk 17.8.11 on CentOS 7.5 successfully.

    1
    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    Hello @Ivan, glad to hear that the instruction has helped. However, MariaDB 10.2 and 10.3 are not yet officially supported by Plesk.

    0
    Comment actions Permalink
  • Avatar
    Learning Curve

    We followed the instructions provided on here and upgraded MariaDB 10.1 to MariaDB 10.2 on Ubuntu 18.04.1 running Plesk 17.8.11 #19 where MariaDB 10.2 is now officially supported. It worked first time, perfectly, with no issues.

    1
    Comment actions Permalink
  • Avatar
    Alexandr Tumanov

    @Learning Curve, great!

    0
    Comment actions Permalink
  • Avatar
    Bruno Schrotter (Edited )

    Hello Ivan!

    I have Plesk Onyx Version 17.8.11 Update #19 on a CentOS Linux 7.5.1804 (Core) with a MySQL (Maria DB I belief) ver.5.5.60. on a dedicated server.

    I have a script that requires MySQL ver. 5.6, and error flags with [No MySQL available] when I tried to install it just to see.

    The script developer tells me to move to a server with Cpanel, and that is out of the question, as I have used Plesk since version 7 or 8 I believe. I cannot get a refund either, as this is not a script failure, and I'm not going to write off $800 either, and there's no other script with what I need anyway.

    I have currently 2 servers with Plesk licenses, and I can experiment with one not so important.
    However, my time is on a tremendous squeeze, so I would like to start out with something that works without trying to experiment with version after version.

    Should I try to install the latest MariaDB 10.3, or is it possible to install a MySQL 5.6 as required, and a better option. I would appreciate your opinion. Thank you kindly!

    0
    Comment actions Permalink
  • Avatar
    Kevin Hudson

    I am running the latest version of Plesk Onyx for Linux 17.8.11 with CentOS 7.5.1804 and I want to Upgrade the MySQL Server from 5.5 to 5.7.

    For software specific reasons, I do not want to Upgrade to MariaDB 10.X. Does anyone know if the instructions above for CentOS 6 will work for CentOS 7.5?

    0
    Comment actions Permalink
  • Avatar
    Alexandr Redikultsev

    Hi @Bruno Schrotter!

    As MariaDB is a replacement for MySQL, upgrade it to MariaDB 10.1 (that is equal to MySQL 5.6). Just follow the instructions for CentOS 7, it should work as expected.

    1
    Comment actions Permalink
  • Avatar
    Alexandr Redikultsev (Edited )

    Hi @Kevin Hudson!

    Instructions for CentOS 6 will not work as CentOS 6 has MySQL by default.

    What you need to do in order to achieve your goal is to replace MariaDB with MySQL 5.5 and then upgrade MySQL 5.5 to MySQL 5.7. Replacement might have some issues with compatibility.

    I was not able to find the repo for MySQL 5.5 for CentOS 7, however if you find one, something like this should do the trick for you:

    1. Stop MariaDB:

    # service mariadb stop

    2. Remove it:

    # rpm -e --nodeps mariadb-server

    3. Add your custom repo with mysql 5.5.

    4. Install packages from this repo:

    # yum install mysql-server mysql-community-server

    5. Then, start the service, run mysql_upgrade:

    # service mysqld start
    # mysql_upgrade -uadmin -p`cat /etc/psa/.psa.shadow`

    6. Refresh server components:

    # plesk sbin packagemng -sdf

    Note that you might want to install packages manually on step 4 in case you will not be able to find the repo on step 3. 

     

    Please, keep in mind that this instructions were not tested and I suggest to create a snapshot of the server as well as the backup of MySQL databases before doing so.

    1
    Comment actions Permalink
  • Avatar
    Bruno Schrotter

    Thanks @Alexandr Redikultsev!
    I very much appreciate your kind response and suggestion.

    0
    Comment actions Permalink
  • Avatar
    Alexandr Redikultsev

    You are welcome, @Bruno Schrotter!

    0
    Comment actions Permalink
  • Avatar
    Multimedia Pool

    Thank You very much Plesk Support Team ! ! ! It worked easy and successful like in the tutorial. Three days ago I reinitialized my 1und1 dedicated server with new Ubuntu 18.04.1 with Plesk 17.8.11 and MariaDB 10.1.36.

    NOW MariaDB 10.2.18 - PLESK is awesome 'n' great - Greets

    1
    Comment actions Permalink
  • Avatar
    Alisa Kasyanova

    @Markus Wernecke

    Good to know that the article helped! Enjoy your Plesk :)

    1
    Comment actions Permalink
  • Avatar
    Patrick Meppe

    Hello there.

    Nice article, I upgraded my MySQL server from  5.5 to 5.7 on Ubuntu 14.04 successfully.

    When restarting my server I ran through the following warning: MySQL 5.7 No directory, logging in with HOME=/ 

    My solution (for the time being) is/was to change home directory of mysql

    # service mysql stop
    # usermod -d /var/lib/mysql/ mysql
    # service mysql start
    0
    Comment actions Permalink
  • Avatar
    Jeremy A Gruver

    This fixed my issues on the latest Plesk 17.8 --- was migrating from Ubuntu 18. Used CloudLinux, it caused a lot of issues. So don't do CloudLinux first -- YOU WILL run into issues... MIGRATE YOUR ACCOUNTS FIRST, then add your extensions like CloudLinux and Litespeed.

    0
    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    Hello @Jeremy,

    Thank you for sharing your user experience.

    For further issues feel free to contact Plesk Technical Support.

    0
    Comment actions Permalink
  • Avatar
    Domenico (Edited )

    hi, I tried to update the MySQL version by following the guide but the operation stopped at point 8. 

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

    and I receive the error:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql_upgrade -uadmin
    Version check failed. Got the following error when calling the 'mysql' command line client
    ERROR 1045 (28000): Access denied for user 'admin'@'localhost' (using password: YES)
    FATAL ERROR: Upgrade failed

     

    thanks

    0
    Comment actions Permalink
  • Avatar
    Alexandr Redikultsev

    Hi @Domenico,

    The command should be working well in case there is no other issue involved here. Try checking this in the following manner:

    1. Check whether or not you can access MySQL with any of the following commands:

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

    OR 

    # plesk db

    OR 

    # mysql psa -uadmin -p`cat /etc/psa/.psa.shadow`

    2. I also would recommend checking whether or not you have /root/.my.cnf file and removing it if any.

    0
    Comment actions Permalink
  • Avatar
    Domenico

    thanks for the reply
    now I'm stuck at point 10,

    if I ask the status of the mariadb comes out like this:

    # systemctl status mariadb
    ? mariadb.service - MariaDB 10.1.37 database server
    Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
    Drop-In: /etc/systemd/system/mariadb.service.d
    +-migrated-from-my.cnf-settings.conf
    Active: active (running) since Sun 2019-01-20 18:12:20 CET; 42s ago
    Docs: man:mysqld(8)
    https://mariadb.com/kb/en/library/systemd/
    Process: 14024 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
    Process: 13985 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
    Process: 13982 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
    Main PID: 13997 (mysqld)
    Status: "Taking your SQL requests now..."
    Tasks: 26
    Memory: 128.3M
    CGroup: /system.slice/mariadb.service
    +-13997 /usr/sbin/mysqld

    Jan 20 18:12:20 server88 mysqld[13997]: 2019-01-20 18:12:20 140304080845056 [Note] InnoDB: Highest supported file format is Barracuda.
    Jan 20 18:12:20 server88 mysqld[13997]: 2019-01-20 18:12:20 140304080845056 [Note] InnoDB: 128 rollback segment(s) are active.
    Jan 20 18:12:20 server88 mysqld[13997]: 2019-01-20 18:12:20 140304080845056 [Note] InnoDB: Waiting for purge to start
    Jan 20 18:12:20 server88 mysqld[13997]: 2019-01-20 18:12:20 140304080845056 [Note] InnoDB: Percona XtraDB (http://www.percona.com) ... 1616887
    Jan 20 18:12:20 server88 mysqld[13997]: 2019-01-20 18:12:20 140304080845056 [Note] Plugin 'FEEDBACK' is disabled.
    Jan 20 18:12:20 server88 mysqld[13997]: 2019-01-20 18:12:20 140303289808640 [Note] InnoDB: Dumping buffer pool(s) not yet started
    Jan 20 18:12:20 server88 mysqld[13997]: 2019-01-20 18:12:20 140304080845056 [Note] Server socket created on IP: '::'.
    Jan 20 18:12:20 server88 mysqld[13997]: 2019-01-20 18:12:20 140304080845056 [Note] /usr/sbin/mysqld: ready for connections.
    Jan 20 18:12:20 server88 mysqld[13997]: Version: '10.1.37-MariaDB' socket: '/var/lib/mysql/mysql.sock' port: 3306 MariaDB Server
    Jan 20 18:12:20 server88 systemd[1]: Started MariaDB 10.1.37 database server.
    Hint: Some lines were ellipsized, use -l to show in full.

    but when I launch point 10 it comes out like this:

    # plesk sbin packagemng -sdf
    -bash: plesk: command not found

    Naturally I can not access plesk

    in /root/.my.cnf I do not have this file

    0
    Comment actions Permalink
  • Avatar
    Alisa Kasyanova

    @Domenico

    Check if any Plesk-related packages were removed during the upgrade of MariaDB (in /var/log/yum.log they should be marked as "erased").
    If there were, run the autoinstaller and reinstall them:

    # wget https://autoinstall.plesk.com/plesk-installer
    # chmod +x plesk-installer
    # ./plesk-installer

    1
    Comment actions Permalink
  • Avatar
    Domenico

    @Alisa,

    thanks for your kind reply, I tried several times to reinstall plesk, in yum.log I see different Erased: plesk ... I made the commands you indicated, part of the installation but crashes with this error:


    Checking for the group 'psaserv'...
    Trying to add supplementary group 'psaserv' for user 'psaadm'... already there
    Checking for the group 'psacln'...
    Group 'psacln' already exists

    Checking that /usr/local/psa/bin/chrootsh registered as login shell...
    /usr/local/psa/bin/chrootsh already registered as a login shell


    ===> Performing safe prep-install database actions

    Trying to start service mysql... active
    done
    Trying to establish test connection... ERROR 1045 (28000): Access denied for user 'admin'@'localhost' (using password: YES)
    ERROR 1045 (28000): Access denied for user 'admin'@'localhost' (using password: YES)

    failed

    ERROR while trying to establish test connection
    Check the error reason(see log file: /var/log/plesk/install/plesk_17.8.11_installation.log), fix and try again

    ***** problem report *****
    ERROR while trying to establish test connection
    Check the error reason(see log file: /var/log/plesk/install/plesk_17.8.11_installation.log), fix and try again
    sh: /etc/init.d/psa: No such file or directory

    ERROR: An error occurred during performing of installation PREP actions (see log for details). Installation was rolled back.
    Warning! Not all packages were installed.
    Please check if your system services are operable.
    Please resolve this issue and try to install the packages again.
    If you cannot resolve the issue on your own, contact product technical support for assistance.

    0
    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    Hello @Domenico,

    From the provided logs I see that Plesk is not able to establish a connection with MariaDB.

    Initial troubleshooting steps are the same as provided by @Alexander:

    1. Check whether or not you can access MySQL with any of the following commands:

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

    OR 

    # plesk db

    OR 

    # mysql psa -uadmin -p`cat /etc/psa/.psa.shadow`

    2. I also would recommend checking whether or not you have /root/.my.cnf file and removing it if any.

     

    As the issue is rather complicated and there is Plesk downtime, I would suggest submitting a request for Plesk Support

     

    1
    Comment actions Permalink
  • Avatar
    Domenico

    hello Ivan, thanks for the reply

    if you activate the commands indicated by you, this happens:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -uadmin psa
    ERROR 1045 (28000): Access denied for user 'admin'@'localhost' (using password: YES)
    # plesk db
    -bash: plesk: command not found
    # mysql psa -uadmin -p`cat /etc/psa/.psa.shadow`
    ERROR 1045 (28000): Access denied for user 'admin'@'localhost' (using password: YES)

    in root/ I do not have the file /.my.cnf
    I see a file named .mysql_history

    I tried to make a request to the support, but it tells me that my license was sold by a retailer and I can not go on, my dealer does not help me because I did not buy this

    0
    Comment actions Permalink
  • Avatar
    Domenico

    now the server is compromised and I'm giving up, in 10 days my subscription expires and I will let him die

    0
    Comment actions Permalink
  • Avatar
    Artyom Baranov

    @Domenico,

    Hello,

    In such case, it is still possible to get support from Plesk directly. Please check the article How to get support directly from Plesk?

    Plesk support subscription will allow you to submit a request if you decide to continue with MySQL upgrade.

    0
    Comment actions Permalink
  • Avatar
    Multimedia Pool (Edited )

    Hi,

    two little things. First, the repo/mirror "mirror.host.ag" in capital city of Bulgaria, Sofia, provided in the tutorial is not accessable since last week. I had to choose another one, because I got the following error [HUB] Plesk Update Manager (PUM) fails: pum is called with arguments.

    Second is a question. Is it possible to upgrade from 10.2 to 10.3 or do you recommend to wait a while? Because on the mirrors site shows MariaDB 10.3 release for Ubuntu 18.04 LTS as "stable".

    Lots of greets

    0
    Comment actions Permalink
  • Avatar
    Kuzma Ivanov

    Hey there Markus,

    1. Looks like not only in Bulgaria the repo http://mirror.host.ag/ is unavailable. We've already replaced it with a different one - http://mirror.truenetwork.ru.
    Thanks for bringing this to our attention.

    2. MariaDB 10.3 is not yet supported by Plesk. Support for this version will be added in the upcoming major release. It is now reflected in the article as well.

    0
    Comment actions Permalink
  • Avatar
    Alejandro Stendelis

    Hi I get this error, how I can fix it??

    CentOS 6.8

    mysql Ver 14.14 Distrib 5.5.30, for Linux (x86_64) using readline 5.1

     

     

    [root@casadimaco ~]# yum update mysql
    Loaded plugins: fastestmirror
    Setting up Update Process
    Loading mirror speeds from cached hostfile
    * base: mirror.fileplanet.com
    * extras: mirrors.oit.uci.edu
    * updates: mirrors.usc.edu
    Resolving Dependencies
    --> Running transaction check
    ---> Package mysql.x86_64 0:5.5.30-1.el6.remi will be obsoleted
    --> Processing Dependency: mysql(x86-64) = 5.5.30-1.el6.remi for package: mysql-bench-5.5.30-1.el6.r emi.x86_64
    --> Processing Dependency: mysql(x86-64) = 5.5.30-1.el6.remi for package: mysql-server-5.5.30-1.el6. remi.x86_64
    --> Processing Dependency: mysql(x86-64) = 5.5.30-1.el6.remi for package: mysql-devel-5.5.30-1.el6.r emi.x86_64
    ---> Package mysql-community-client.x86_64 0:5.7.25-1.el6 will be obsoleting
    --> Processing Dependency: mysql-community-libs(x86-64) >= 5.7.9 for package: mysql-community-client -5.7.25-1.el6.x86_64
    --> Running transaction check
    ---> Package mysql-bench.x86_64 0:5.5.30-1.el6.remi will be obsoleted
    ---> Package mysql-community-devel.x86_64 0:5.7.25-1.el6 will be obsoleting
    ---> Package mysql-community-libs.x86_64 0:5.7.25-1.el6 will be obsoleting
    --> Processing Dependency: mysql-community-common(x86-64) >= 5.7.9 for package: mysql-community-libs -5.7.25-1.el6.x86_64
    ---> Package mysql-community-server.x86_64 0:5.7.25-1.el6 will be obsoleting
    --> Processing Dependency: libnuma.so.1(libnuma_1.2)(64bit) for package: mysql-community-server-5.7. 25-1.el6.x86_64
    --> Processing Dependency: libnuma.so.1(libnuma_1.1)(64bit) for package: mysql-community-server-5.7. 25-1.el6.x86_64
    --> Processing Dependency: libnuma.so.1()(64bit) for package: mysql-community-server-5.7.25-1.el6.x8 6_64
    ---> Package mysql-devel.x86_64 0:5.5.30-1.el6.remi will be obsoleted
    ---> Package mysql-libs.x86_64 0:5.5.30-1.el6.remi will be obsoleted
    --> Processing Dependency: libmysqlclient.so.18()(64bit) for package: php-mysql-5.4.13-1.el6.remi.x8 6_64
    --> Processing Dependency: libmysqlclient.so.18(libmysqlclient_16)(64bit) for package: php-mysql-5.4 .13-1.el6.remi.x86_64
    --> Processing Dependency: libmysqlclient.so.18(libmysqlclient_18)(64bit) for package: php-mysql-5.4 .13-1.el6.remi.x86_64
    ---> Package mysql-server.x86_64 0:5.5.30-1.el6.remi will be obsoleted
    --> Running transaction check
    ---> Package mysql-community-common.x86_64 0:5.7.25-1.el6 will be installed
    ---> Package mysql-libs.x86_64 0:5.5.30-1.el6.remi will be obsoleted
    --> Processing Dependency: libmysqlclient.so.18()(64bit) for package: php-mysql-5.4.13-1.el6.remi.x8 6_64
    --> Processing Dependency: libmysqlclient.so.18(libmysqlclient_16)(64bit) for package: php-mysql-5.4 .13-1.el6.remi.x86_64
    --> Processing Dependency: libmysqlclient.so.18(libmysqlclient_18)(64bit) for package: php-mysql-5.4 .13-1.el6.remi.x86_64
    ---> Package numactl.x86_64 0:2.0.9-2.el6 will be installed
    --> Finished Dependency Resolution
    Error: Package: php-mysql-5.4.13-1.el6.remi.x86_64 (installed)
    Requires: libmysqlclient.so.18()(64bit)
    Removing: mysql-libs-5.5.30-1.el6.remi.x86_64 (installed)
    libmysqlclient.so.18()(64bit)
    Obsoleted By: mysql-community-libs-5.7.25-1.el6.x86_64 (mysql57-community)
    Not found
    Available: mysql-libs-5.5.28-3.el6.remi.x86_64 (mt_dv_extras)
    libmysqlclient.so.18()(64bit)
    Available: mysql-libs-5.5.29-1.el6.remi.x86_64 (mt_dv_extras)
    libmysqlclient.so.18()(64bit)
    Available: mysql-libs-5.1.73-8.el6_8.i686 (base)
    Not found
    Error: Package: php-mysql-5.4.13-1.el6.remi.x86_64 (installed)
    Requires: libmysqlclient.so.18(libmysqlclient_18)(64bit)
    Removing: mysql-libs-5.5.30-1.el6.remi.x86_64 (installed)
    libmysqlclient.so.18(libmysqlclient_18)(64bit)
    Obsoleted By: mysql-community-libs-5.7.25-1.el6.x86_64 (mysql57-community)
    Not found
    Available: mysql-libs-5.5.28-3.el6.remi.x86_64 (mt_dv_extras)
    libmysqlclient.so.18(libmysqlclient_18)(64bit)
    Available: mysql-libs-5.5.29-1.el6.remi.x86_64 (mt_dv_extras)
    libmysqlclient.so.18(libmysqlclient_18)(64bit)
    Available: mysql-libs-5.1.73-8.el6_8.i686 (base)
    Not found
    Error: Package: php-mysql-5.4.13-1.el6.remi.x86_64 (installed)
    Requires: libmysqlclient.so.18(libmysqlclient_16)(64bit)
    Removing: mysql-libs-5.5.30-1.el6.remi.x86_64 (installed)
    libmysqlclient.so.18(libmysqlclient_16)(64bit)
    Obsoleted By: mysql-community-libs-5.7.25-1.el6.x86_64 (mysql57-community)
    Not found
    Available: mysql-libs-5.5.28-3.el6.remi.x86_64 (mt_dv_extras)
    libmysqlclient.so.18(libmysqlclient_16)(64bit)
    Available: mysql-libs-5.5.29-1.el6.remi.x86_64 (mt_dv_extras)
    libmysqlclient.so.18(libmysqlclient_16)(64bit)
    Available: mysql-libs-5.1.73-8.el6_8.i686 (base)
    Not found
    You could try using --skip-broken to work around the problem
    You could try running: rpm -Va --nofiles --nodigest

    0
    Comment actions Permalink
  • Avatar
    Vladimir Chernikov

    Hello @Alejandro Stendelis,

    Try to clean up the list of the mirrors.

    1. Install yum utils:
    # yum install yum-utils

    2. Run the following command:
    # yum clean all

    If the issue still persists, please submit the ticket and we investigate the issue:
    How to submit a request to Plesk support?

    0
    Comment actions Permalink

Please sign in to leave a comment.

Have more questions? Submit a request