How to upgrade MySQL 5.5 to 5.6/5.7 or MariaDB 5.5 to 10.x on Linux?

Follow

Comments

224 comments

  • Avatar
    Ivan Postnikov

    Hello @Alexander! Usually, it is not required. 

    0
    Comment actions Permalink
  • 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

    0
    Comment actions Permalink
  • Avatar
    Anzhelika Khapaknysh

    @murat,

    Such issues required investigation on the server.

    Please contact our Support Team for assistance.

    0
    Comment actions Permalink
  • Avatar
    Yulia Plokhotnikova

    Hi @Vinod Vyas,

    You need to find the command for a package manager that depends on your server OS. You may search in the internet for the proper command applicable for your OS as it is not managed by Plesk. For example, there are yum and rpm package managers used on Centos, CloudLinux or Red Hat OS and one of available commands would be the following:

    # rpm -qa | grep mariadb

    0
    Comment actions Permalink
  • Avatar
    Jan Bludau

    Hello @Dinara Aspembitova,

    Cool, very fast :-)

    0
    Comment actions Permalink
  • 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

    0
    Comment actions Permalink
  • Avatar
    Markus (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
    Jan Bludau (Edited )

    Update  Plesk Onyx 17.8.11 Update Nr. 54 to Mariadb 10.4 from 10.3

    1. rpm -q --whatprovides mysql-server
    2. If it is installed and the command above gives output, remove using the following command:

      rpm -e --nodeps `rpm -q --whatprovides mysql-server`

    3. Configure MariaDB repository: open the Setting MariaDB repositories page, select your OS distro, release and a desired MariaDB version. Once done, the configuration that should be added to the /etc/yum.repos.d/MariaDB.repo file will appear.

      Here is an example for MariaDB 10.2:

      6.1. Open/create the MariaDB.repo file in any text editor. In this example, we are using the vi editor:

      vi /etc/yum.repos.d/MariaDB.repo

      6.2. Add the content below to the file:

      [mariadb]
      name = MariaDB
      baseurl = http://yum.mariadb.org/10.4/centos7-amd64
      gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
      gpgcheck=1

      6.3. Save the changes and close the file.

     

     --> new between the next step in the guide

    # yum -y update

    # yum install MariaDB-client MariaDB-server

    if you receive a conflict with "galera-25.3.26-1" because you had installed mariadb 10.3 

    # rpm -e galera-25.3.26-1.rhel7.el7.centos.x86_64 ... 

    # yum install MariaDB-client MariaDB-server

    --> Now follow the normal guide... 

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

    ....

    # service mariadb restart

    0
    Comment actions Permalink
  • Avatar
    Anzhelika Khapaknysh (Edited )

    Hi @Hopjanj,

    Since MariaDB 10.2 default-tmp-storage-engine (in MySQL called internal_tmp_disk_storage_engine) was changed from MyISAM to InnoDB, which has certain limitations.

    In general, you may ignore the above warning.

    However, to avoid any potential issues with others (not Plesk) databases:

    1. Login server via SSH;
    2. Change  default-tmp-storage-engine back to MyISAM in [mysqld] section of /etc/my.cnf using text editor:

      grep default-tmp-storage-engine /etc/my.cnf
      default-tmp-storage-engine=MyISAM

    3. Restart MariaDB:

      service mariadb restart

     

    0
    Comment actions Permalink
  • Avatar
    Christopher-James Sheppard

    is there a possibility to roll back to the previous MariaDB version if any part of the install fails? Im on CentOS 7, MariaDB 5.5.6 and am a little hesitant to go ahead as we have 10+ Wordpress installs on the server

    0
    Comment actions Permalink
  • Avatar
    WeHoDo

    @Ivan,

     

    Thank you for your quick reply.
    I will have a look.

    0
    Comment actions Permalink
  • Avatar
    Gilberto Greppi

    HI,

    I have installed Obsidian and now some client has problem to import Database (utf8_unicode_520_ci). Your raccomended instruction ist to upgrade MariaDB.Questions:

    - can I use with Obsidian and install from Red Hat Softwer Collection the MariaDB10.3?

    - can I migrate  MariaDB 5.5.64 direct to MariaDB 10.3? On RedHat Manual they raccomand to migrate to Version 10 at first and than to 10.3    https://access.redhat.com/documentation/en-us/red_hat_software_collections/3/html/3.3_release_notes/chap-migration

    - can I use your instrution for Cento OS to migrate to MariaDB 10.3

    Thanks in advice

     

    0
    Comment actions Permalink
  • Avatar
    Rashid Qureshi

    I have followed this Article. 

    Everything went fine but the Mysql version still shows to be 5.5?

     

    What did I do wrong?

    0
    Comment actions Permalink
  • Avatar
    Miguel Ángel (Edited )

    Hi!! :)

    After upgrade mariaDB (5.5.65 >> 10.2.34) doesn't start with mysqld_safe option :(

    Any ideas?

    Thanks!

    0
    Comment actions Permalink
  • Avatar
    Artur Beqiraj

    @Vitaly Zhidkov 

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

    0
    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    @Louis-Philippe Frenette

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

    0
    Comment actions Permalink
  • 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.

    0
    Comment actions Permalink
  • Avatar
    Thomas Friedrich

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

    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
    francesco

    What about this error? upgrading on debian 9 from mariadb 10.1 to 10.2

    Any clue how to fix it and continue upgrade?

    Removing mariadb-server-10.1 (10.1.47-0+deb9u1) ...
    (Reading database ... 97403 files and directories currently installed.)
    Preparing to unpack .../mariadb-server-10.2_10.2.36+maria~stretch_amd64.deb ...
    /var/lib/mysql: found previous version 10.1
    Unpacking mariadb-server-10.2 (10.2.36+maria~stretch) ...
    dpkg: error processing archive /var/cache/apt/archives/mariadb-server-10.2_10.2.36+maria~stretch_amd64.deb (--unpack):
    trying to overwrite '/usr/bin/mysql_install_db', which is also in package mariadb-server-core-10.1 10.1.47-0+deb9u1
    dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
    Errors were encountered while processing:
    /var/cache/apt/archives/mariadb-server-10.2_10.2.36+maria~stretch_amd64.deb
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    0
    Comment actions Permalink
  • Avatar
    Vinod Vyas

    I am upgrading MariaDB 5.5 to v10.3

    What is the command to FIND if any additional packages like mariadb-bench are installed.

     

    0
    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    Hello,

    Mark S. 10.5 should also work fine. The article author will double-check it and add corresponding instructions.

    Learning Curve Thank you for the feedback. These points will be also reviewed and we'll look at how to improve the article.

    0
    Comment actions Permalink
  • Avatar
    Nerque

    Since message approval takes a long time, I tried to perform the actions I listed above, and some recommended from other sites, by uninstalling mariadb 5.5, just in case.

    ------------------------------------------------------

    mysqldump -u admin -p`cat /etc/psa/.psa.shadow` --all-databases --routines --triggers > ~/backup/all-databases.sql

    for DB in $(mysql -uadmin -p`cat /etc/psa/.psa.shadow` -B -e "show databases" -s --skip-column-names); do
        mysqldump -u admin -p`cat /etc/psa/.psa.shadow` $DB > ~/backup/$DB.sql
    done

     

    mysql -uadmin -p`cat /etc/psa/.psa.shadow` -B -e "SET GLOBAL innodb_fast_shutdown=0;"

    systemctl stop monit.service

    systemctl disable mariadb

    systemctl stop mariadb

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

    cp /etc/my.cnf ~/backup/

    cp -v -a /etc/my.cnf.d/ ~/backup/

    rpm -e --nodeps `rpm -q --whatprovides mariadb-server`

     

    vi /etc/yum.repos.d/MariaDB.repo

    [mariadb]

    name = MariaDB

    baseurl = http://yum.mariadb.org/10.3/centos7-amd64

    gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB

    gpgcheck=1

     

    yum install MariaDB-server MariaDB-client MariaDB-shared MariaDB-backup MariaDB-common

    systemctl enable mariadb

    systemctl restart mariadb

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

    systemctl restart mariadb

    plesk sbin packagemng -sdf

    mysql -uadmin -p`cat /etc/psa/.psa.shadow` -B -e "SELECT VERSION();"

    systemctl restart monit.service

    ------------------------------------------------------

     

    And... apparently, everything's fine. All the websites are working as before... Good.

     

     

    0
    Comment actions Permalink
  • Avatar
    Artyom Baranov

    @Richard Mountain,

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

    # plesk version

    # mysql -V
    0
    Comment actions Permalink
  • Avatar
    Nerque

    First of all, thanks for the answer.

    If it is not necessary to uninstall the current version of MariaDB (5.5), could I update MariaDB, instead of uninstalling the old version and installing the new one(10.3)?

    I understood from some site that it was not recommended, and that it was better to uninstall version 5.5 and then install version 10.3. I don't know if that's true.

    If an upgrade were possible, I suppose the steps would be:

    -------------------------------------------------

    MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqldump -u admin --all-databases --routines --triggers > /tmp/all-databases.sql

    service mariadb stop

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

     

    vi /etc/yum.repos.d/MariaDB.repo

    [mariadb]

    name = MariaDB

    baseurl = http://yum.mariadb.org/10.3/centos7-amd64

    gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB

    gpgcheck=1

     

    yum -y upgrade maria*

    systemctl restart mariadb

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

    systemctl restart mariadb

    plesk sbin packagemng -sdf

    -----------------------------------------

    Is this all right?

     

    And, although a copy of the databases is made, with the dump and copy of the mysql folder, I am not very clear about the process to recover it in case of disaster. Uninstall MariaDB 10.3, remove the repo file, reinstall the default version of centos, restore mysql folder and then recover the dump? Would this be the right order? Is it necessary to restore the mysql folder or is it enough to recover the dump?

     

    Thank you in advance

     

    0
    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    Hello Necro

    > What is " 'mysql' init script"

    This is a leftover from previously installed MySQL server. Init script is a script for a service to start on boot.

    > Should i run those final steps anyway?

    The last step is required to make sure the processes of old MySQL version are stopped, to start MariaDB if not started, and to make sure that MariaDB will start after the server reboot. I would recommend not avoiding it.

    0
    Comment actions Permalink
  • Avatar
    Robert Asilbekov

    Sid B 

    > I actually expected it to be available as a module to update/upgrade in the Plesk installer, but it isn't?

    A database server is shipped by the OS vendor and Plesk itself does not manage its update/upgrade. Because the upgrade process can involve many pitfalls that only a server administrator would know about. 

    > Is Plesk going to add MariaDB 10 as a module install or upgrade to the Plesk installer
    any time soon?

    No information available at the moment. Please monitor Plesk Release Notes to have up-to-date information.

    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
    Alexandr Tumanov

    @Learning Curve, great!

    0
    Comment actions Permalink
  • Avatar
    Kingsley Felix (Edited )

    the commands for debian 9 is FAILING, NOT FOUND ERROR.

     

    # curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash -s -- --mariadb-server-version=mariadb-10.3
    -bash: sudo: command not found
    curl: (23) Failed writing body (360 != 1369)

    0
    Comment actions Permalink

Please sign in to leave a comment.

Have more questions? Submit a request