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

44 comments

  • 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.

  • Avatar
    Artur Beqiraj

    Hello Alexandr and thank you for your reply

    But I have a soft who works only with mysql 5.6 or MariaDB 10.0.27

    For this reason i am using the cpanel
    But I'm not practical with it, Because I've always used plesk on my servers. Your article
    gives you the opportunity to upgrate but if I changed the url to

    baseurl = http://yum.mariadb.org/10.2/centos7-amd64 in /10.0.27/  run into errors 

    for this reason i ask you

    thanks

  • Avatar
    Ivan Postnikov

    Hello @Alexander! Usually, it is not required. 

  • Avatar
    Vitaly Zhidkov

    @Artur, in case you need some specific version of MariaDB, you can specify it in repository configuration file in baseurl. For 10.0.27 for CentOS 7 it will be http://yum.mariadb.org/10.0.27/centos7-amd64

  • Avatar
    Vitaly Zhidkov

    @Definedhostinguk this can be only a workaround, not a fix. Check the /var/log/mysqld.log for error messages and search for articles in our Help Center

  • Avatar
    Artur Beqiraj

    @Vitaly Zhidkov 

    i have specific it but dont work so does not successfully complete the installation

  • Avatar
    Ivan Postnikov

    @Louis-Philippe Frenette

    Thank you for sharing the workaround.
    It may be useful to another Pleskians.

  • Avatar
    Artyom Baranov

    @Peter Jablonski,

    Direct upgrade of MySQL 5.1 to MySQL 5.6/5.7 will damage tables (There is the warning message at the top of this article).

    It's strongly recommended to upgrade to MySQL 5.5 at first.

  • Avatar
    Thomas Friedrich

    With Ubuntu 14.04 I had to restart mysql before step 7 worked.

  • 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.

  • Avatar
    Artyom Baranov

    @Richard Mountain,

    Hello! Please provide me with the output of the following commands:

    # plesk version

    # mysql -V
  • Avatar
    Alexandr Tumanov

    @Learning Curve, great!

  • Avatar
    Ivan Postnikov

    @Alexander, thank you for letting us know your experience!

  • 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.

     

  • Avatar
    Louis-Philippe Frenette

    For those like me who installed mysql from the webtatic repo here's the workaround to upgrade to 5.6 or 5.7 on Centos 6:

     

    instead of 

    # yum update mysql

    write the following:

    # yum replace mysql55w --replace-with=mysql-community-client mysql55w-libs --replace-with=mysql-community-libs mysql55w-server --replace-with=mysql-community-server

     

  • Avatar
    Alexander Hammer

    Dear Ivan, I can answer my own question. When checking the status of the MariaDB service, there where an error message regarding the innodb table(s). After I ran "mysql_upgrade" command the error was gone.

  • Avatar
    Stefan

    Thank you for the guide, I sucessfully updated mysql 5.1 to mysql 5.6 on centos 6 with plesk 17.5.3.

    Now, how do I upgrade / replace this mysql 5.6 to maria db 10.1?

  • Avatar
    Bruno Schrotter

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

  • Avatar
    Artur Beqiraj

    i have centos 7 end plesk Onyx end i need to have mariaDB 10.0.27 is possible ?

    Is there any way to get this version?

    thanks

  • Avatar
    Alexandr Redikultsev

    You are welcome, @Bruno Schrotter!

  • Avatar
    Keith Arnold (Edited )

    Hi,

    I've just followed the instructions for upgrading on Centos 6 and all appeared to go ok.
    But then some of the tables started showing the following error:

    Native table 'performance_schema'.'session_variables' has the wrong structure

    A quick Google later and it appears I needed to have done

    service mysqld restart

    after the mysql_upgrade. I now don't appear to have the 'wrong structure' errors anymore.

  • Avatar
    Bulat Tsydenov

    @Jonathan instead of 'service mariadb stop' you can try to run 'systemctl stop mariadb.service'. As for 'yum repolist', as it is described in "For CentOS 7" section of this article, make sure you create `/etc/yum.repos.d/MariaDB10.1.repo` file with the corresponding content.

  • Avatar
    Alexandr Tumanov

    Hello @Artur Beqiraj

    We recommend upgrading to MariaDB 10.1 at least. There is no significant difference, however, it will be easier to install MariaDB 10.1 or 10.2

  • Avatar
    Peter Jablonski (Edited )

    It didn't work for me in 100%.

    I was upgrading MySQL 5.1 to 5.7 om my CentOS 6 and I couldn't start mysql.

    # service mysqld start - gave me nothing, even no single line in /var/log/mysqld.log.

     

    What I did:

    1. I started mysql service from a file /usr/sbin/msqld to check what a problem was

    2. The problem was in config file /etc/my.cnf

    [ERROR] unknown variable 'innodb_additional_mem_pool_size=500K'

    I had to comment this line.

    3. After that I had a problem with access to the user table. 

    [ERROR] Fatal error: mysql.user table is damaged. Please run mysql_upgrade.

    mysqld --skip-grant-tables - it starts without reading the user table

    mysql_upgrade - then I could upgrade my tables

    killall mysqld - killing all the mysql instances

    4. Finally 

    # service mysqld start

  • Avatar
    Cogeco Peer 1 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

  • Avatar
    Artur Beqiraj

    Artyom Baranov

    i have specific but has in this error after instalation 

     

    Transaction check error:
    file /etc/init.d/mysql conflicts between attempted installs of MariaDB-server-10.0.27-1.el7.centos.x86_64 and MariaDB-Galera-server-10.0.27-1.el7.centos.x86_64
    file /etc/my.cnf.d/server.cnf conflicts between attempted installs of MariaDB-server-10.0.27-1.el7.centos.x86_64 and MariaDB-Galera-server-10.0.27-1.el7.centos.x86_64
    file /usr/bin/aria_chk conflicts between attempted installs of MariaDB-server-10.0.27-1.el7.centos.x86_64 and MariaDB-Galera-server-10.0.27-1.el7.centos.x86_64
    file /usr/bin/aria_dump_log conflicts between attempted installs of MariaDB-server-10.0.27-1.el7.centos.x86_64 and MariaDB-Galera-server-10.0.27-1.el7.centos.x86_64
    file /usr/bin/aria_ftdump conflicts between attempted installs of MariaDB-server-10.0.27-1.el7.centos.x86_64 and MariaDB-Galera-server-10.0.27-1.el7.centos.x86_64
    file /usr/bin/aria_pack conflicts between attempted installs of MariaDB-server-10.0.27-1.el7.centos.x86_64 and MariaDB-Galera-server-10.0.27-1.el7.centos.x86_64
    file /usr/bin/aria_read_log conflicts between attempted installs of MariaDB-server-10.0.27-1.el7.centos.x86_64 and MariaDB-Galera-server-10.0.27-1.el7.centos.x86_64
    file /usr/bin/innochecksum conflicts between attempted installs of MariaDB-server-10.0.27-1.el7.centos.x86_64 and MariaDB-Galera-server-10.0.27-1.el7.centos.x86_64
    file /usr/bin/my_print_defaults conflicts between attempted installs of MariaDB-server-10.0.27-1.el7.centos.x86_64 and MariaDB-Galera-server-10.0.27-1.el7.centos.x86_64
    file /usr/bin/myisam_ftdump conflicts between attempted installs of MariaDB-server-10.0.27-1.el7.centos.x86_64 and MariaDB-Galera-server-10.0.27-1.el7.centos.x86_64
    file /usr/bin/myisamchk conflicts between attempted installs of MariaDB-server-10.0.27-1.el7.centos.x86_64 and MariaDB-Galera-server-10.0.27-1.el7.centos.x86_64
    file /usr/bin/myisamlog conflicts between attempted installs of MariaDB-server-10.0.27-1.el7.centos.x86_64 and MariaDB-Galera-server-10.0.27-1.el7.centos.x86_64
    file /usr/bin/myisampack conflicts between attempted installs of MariaDB-server-10.0.27-1.el7.centos.x86_64 and MariaDB-Galera-server-10.0.27-1.el7.centos.x86_64
    file /usr/bin/mysql_tzinfo_to_sql conflicts between attempted installs of MariaDB-server-10.0.27-1.el7.centos.x86_64 and MariaDB-Galera-server-10.0.27-1.el7.centos.x86_64
    file /usr/bin/mysql_upgrade conflicts between attempted installs of MariaDB-server-10.0.27-1.el7.centos.x86_64 and MariaDB-Galera-server-10.0.27-1.el7.centos.x86_64
    file /usr/bin/mysqlbug conflicts between attempted installs of MariaDB-server-10.0.27-1.el7.centos.x86_64 and MariaDB-Galera-server-10.0.27-1.el7.centos.x86_64

  • Avatar
    Peter Debik

    MariaDB 10.2 is not yet officially supported. It is not causing issues in the panel, but the database repair tool claims that some date/timestamp fields are misconfigured, and it is unable to repair them. It would be good to add a check in the installation routines of Plesk to prohibit an installation on MariaDB 10.2. I only "accidentally" installed it on a 10.2 and found out about the wrong version in a recent support ticket.

  • 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!

  • Avatar
    Richard Mountain

    I've followed the Centos 6 guide, everything seem to install but it's still running MySql 5.5.57 

    I've tried service mysqld restart

    But this doesn't seem to do anything.

  • Avatar
    Bulat Tsydenov

    @Peter It would be great if you provide your suggestion on our Plesk User Voice. Thank you!

Please sign in to leave a comment.

Have more questions? Submit a request