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

Follow

Comments

258 comments

  • Avatar
    Anzhelika Khapaknysh

    Hi @Roberto,

    I'd recommend contacting our Support Team for assistance. They will check this issue in details

    0
    Comment actions Permalink
  • Avatar
    murat (Edited )

    i have ubuntu 18.04.3, Plesk Obsidian 18.0.20 update 2 and mariadb default 10.1

    I applied this article in order.

    after;

    root@sonbahar:~# apt install mariadb-server
    ...
    Job for mariadb.service failed because the control process exited with error code.
    See "systemctl status mariadb.service" and "journalctl -xe" for details.
    invoke-rc.d: initscript mysql, action "start" failed.
    ● mariadb.service - MariaDB 10.2.29 database server
    Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
    Drop-In: /etc/systemd/system/mariadb.service.d
    └─migrated-from-my.cnf-settings.conf
    Active: failed (Result: exit-code) since Sat 2019-11-16 14:58:00 CET; 10ms ago
    Docs: man:mysqld(8)
    ...

    dpkg: error processing package mariadb-server (--configure):
    dependency problems - leaving unconfigured
    Processing triggers for libc-bin (2.27-3ubuntu1) ...
    No apport report written because the error message indicates its a followup error from a previous failure.
    Processing triggers for systemd (237-3ubuntu10.31) ...
    Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
    Processing triggers for ureadahead (0.100.0-21) ...
    Errors were encountered while processing:
    mariadb-server-10.2
    mariadb-server
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    root@sonbahar:~#

     

    PLEASE HELP ME.

    REGARDS

    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
    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
    Anton Maslov

    Hi Gilberto,


    For RedHat please follow their guide. Direct upgrade from 5.5 to 10.3 not recommended.

    0
    Comment actions Permalink
  • Avatar
    Michael Zagaris

    Hello, just upgraded my MariaDB from 5.5 to 10.3 on Plesk Obsidia 18.0.21 and it worked just great..Took me 5 minutes and all websites are working just fine and i believe faster. I upgraded because i believe that 5.5 was causing some freezes on some queries that included SELECT DISTINCT..That happened a lot of times lately, so i hope this gets fixed..i believe it was about Copying tmp tables, or Waiting for table lock isues

    0
    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    Hello Michael Zagaris

    Glad to hear that all went well, thank you for the feedback.

     

    0
    Comment actions Permalink
  • Avatar
    Nerque

    I guess some of the steps are related to the change from mysql to mariadb, right?

    If we consider that we are changing from mariadb 5.5 to mariadb 10.3, in Centos 7.7, could the summary of the steps be like I show below?

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

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

    service mariadb stop

    rpm -qa | grep mariadb

     ==> rpm -e --nodeps <other-mariadb-package>

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

    rpm -q --whatprovides mariadb-server

    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

    systemctl restart mariadb

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

    systemctl restart mariadb

    plesk sbin packagemng -sdf

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

     

    My maridb related packages are:

    plesk-libmariadbclient-3.0-3.0.9-1centos.7.190417.1743.x86_64
    mariadb-libs-5.5.64-1.el7.x86_64
    sw-mariadb-client-1.0.0-centos7.17031417.x86_64
    mariadb-server-5.5.64-1.el7.x86_64
    plesk-libmariadbclient-1.0-1.0.0-1centos.7.190329.1026.x86_64
    mariadb-5.5.64-1.el7.x86_64

     

    So I guess I don't need to uninstall any of them individually, right? I guess with the command "rpm -e --nodeps `rpm -q --whatprovides mariadb-server`" they will be uninstalled

     

    If we follow all these steps, what should we do if something fails and we need to restore the previous version?

     

    0
    Comment actions Permalink
  • Avatar
    Julian Bonpland Mignaquy

    Hi Nerque that is correct, you may skip this part:

    rpm -q --whatprovides mariadb-server

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

    Since you are already running mariadb you do not need to remove mysql.

    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
    Kingsley Felix

    I am on debian 9 and i wish to upgrade mariadb to 10.3

    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
    Ivan Postnikov

    Hello Nerque

    Thank you for the message, glad to hear everything went fine.

    0
    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    Hello Kingsley Felix

    As I can see, you've already contacted our Professional Services for assistance!

    0
    Comment actions Permalink
  • Avatar
    Kingsley Felix

    Yes and am not interested anymore... $147 just to upgrade a DATABASE

    0
    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    Hello Kingsley Felix

    Thank you for the feedback.

    In that case, feel free to do it on your side, following steps from this article, as confirmed by other Pleskians, steps for 10.3 are identical.

    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
  • Avatar
    Anton Maslov

    Hello Kingsley,


    Please install "sudo" command:

    apt-get install sudo -y

    0
    Comment actions Permalink
  • Avatar
    WebITBuero

    Warning: MariaDB 10.3 is supported starting from Plesk Obsidian. Previous versions (Onyx and older) do not support MariaDB 10.3. For details, visit this link.
    "this link" => https://support.plesk.com/hc/en-us/articles/360006201833 is a opps page!

    0
    Comment actions Permalink
  • Avatar
    Alexey Lapshin

    Hello @WebITBuero

    Thank you for bringing our attention on this. The article is updated.

    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
    Ivan Postnikov

    Hello Rashid Qureshi,

    Most probably, you haven't executed this command at the end:

    # plesk sbin packagemng -sdf

     

    0
    Comment actions Permalink
  • Avatar
    Necro (Edited )

    Hi there!

    Thanks for providing this, i used to update MariaDB 5.5.65 on CentOS 7 to MariaDB 10.3, latest stable supported by Plesk.

    Everything went smoothly and no errors so far, however i didn't understand what you mean on the last step:

    Note: After an upgrade, there may appear 'mysql' init script. It should be removed to avoid conflicts with MariaDB service. The same commands can be used to fix already existing conflict.

    What is " 'mysql' init script", is it an error message that appears on the SSH window, on Plesk, on an error log?

    Should i run those final steps anyway?

    systemctl stop mysql; killall mysqld # to stop the incorrect service if it is started
    # rm /etc/init.d/mysql && systemctl daemon-reload # to remove the incorrect service script and reload systemctl configuration
    # systemctl start mariadb # to start MariaDB if not started
    # systemctl enable mariadb # to make sure that MariaDB will start after the server reboot automatically

    Thanks!

    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
    Necro (Edited )

    Ok thanks Ivan!!

    It already seems that Plesk is running much faster on MariaDB 10.3 than on previous 5.5 👍

    Do we need to secure MariaDB? I was reading a tutorial (https://linuxize.com/post/install-mariadb-on-centos-7/) that recommended to run the mysql_secure_installation script which will perform several security related tasks like set up the root user password, remove the anonymous user, restrict root user access to the local machine, and remove the test database.

    Or does Plesk takes care of this already?

    Thanks again!

    0
    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    Hello Necro

    It's recommended to stay with the configuration, predefined by Plesk.

    Also, here're general recommendations for securing Plesk installation: https://support.plesk.com/hc/en-us/articles/115000626925

    0
    Comment actions Permalink
  • Avatar
    Dennis

    Hi,

    After upgrading mariadb from version 10.1 to 10.3 on debian 9.12 plesk does not seem to recognize the mysql service anymore under server components and says "The component was not installed". Everything seems to be working fine though and under "Database Servers" the new version seems in place. I followed the procedure for debian 8/9 in this article and executed the commands to update the package version inside plesk. Below you can find more details regarding my configuration:

    mysql Ver 15.1 Distrib 10.3.23-MariaDB, for debian-linux-gnu (x86_64)

    Plesk Obsidian Web Host Edition
    Version 18.0.27 Update #1

    Thank you in advance for your reply! Cheers

    0
    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    Hello Dennis

    Please, try going to Tools & Settings > Plesk Components and click "Refresh".

    In case this won't help, consider submitting a support request.

    0
    Comment actions Permalink
  • Avatar
    Mark S.

    Hello, I just wanted to update MariaDB to version 10.3.23 under Debian 10. So far all good, after the installation there were errors on an apt --fix-broken install but results in:

    dpkg: regarding .../mariadb-client-core-10.3_1%3a10.3.23+maria~buster_amd64.deb containing mariadb-client-core-10.3:
    mariadb-client-10.3 conflicts with mysql-client-core-5.5
    mariadb-client-core-10.3 provides mysql-client-core-5.5 and is to be installed.

    dpkg: error processing archive /var/cache/apt/archives/mariadb-client-core-10.3_1%3a10.3.23+maria~buster_amd64.deb (--unpack):
    conflicting packages - not installing mariadb-client-core-10.3
    dpkg: regarding .../mariadb-client-10.3_1%3a10.3.23+maria~buster_amd64.deb containing mariadb-client-10.3:
    mariadb-client-core-10.3 conflicts with mysql-client-5.5
    mariadb-client-10.3 provides mysql-client-5.5 and is to be installed.

    dpkg: error processing archive /var/cache/apt/archives/mariadb-client-10.3_1%3a10.3.23+maria~buster_amd64.deb (--unpack):
    conflicting packages - not installing mariadb-client-10.3
    Errors were encountered while processing:
    /var/cache/apt/archives/mariadb-client-core-10.3_1%3a10.3.23+maria~buster_amd64.deb
    /var/cache/apt/archives/mariadb-client-10.3_1%3a10.3.23+maria~buster_amd64.deb
    E: Sub-process /usr/bin/dpkg returned an error code (1)

    Any ideas? If I look at https://packages.debian.org/search?lang=de&searchon=names&keywords=mysql-server-core, the package "mysql-server-core-5.5" for buster does not exist.

    0
    Comment actions Permalink
  • Avatar
    Dennis

    Hi Ivan

     

    I think you mean Tools & Settings > Server Components? I tried that already but that doesn't resolve the issue unfortunately. I'll submit a support request instead. Cheers

    0
    Comment actions Permalink

Please sign in to leave a comment.

Have more questions? Submit a request