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

Comments

57 comments

  • Avatar
    Wyk Parish (Edited )

    On Plesk Version 18.0.49 Update #2, Ubuntu 18.04, and upgrading MariaDB from 10.1 to 10.6.1.  The instructions here didn't work for me as is. Here are the changes in hopes it will help others in my scenario:

    1. In Step 1, I had to be the root user (ie. "sudo -s").  Otherwise I would get a "Permission denied" error trying to access the password file.
    2. In Step 6, the mariadb-server wouldn't restart with the error mentioned in this article.  However, the "/etc/my.cnf" file mentioned in that article did not exist on my system. Instead I made the edit to the "/etc/mysql/my.cnf" file  (ie. changing the line "bind-address = ::ffff:127.0.0.1" to "bind-address = 127.0.0.1"). Then restarting the mariadb-server succeeded and the rest of the instructions seemed to go as planned.
    0
  • Avatar
    HaiSoft

    According to Plesk Changelog, MariaDB 10.11 is supported since Plesk Obsidian 18.0.52, right ?

    1
  • Avatar
    Kelvin Oliveira

    Is there any procedure like this but for Windows?

    1
  • Avatar
    Sam Hawkins

    Has anybody got any steps for AlmaLinux?

    0
  • Avatar
    Julian Bonpland Mignaquy

    Sam Hawkins Hi!

    Please go for Plesk on CentOS 7 / RHEL 7.

    0
  • Avatar
    Andy Morgan (Edited )

    Hi Julian, we're using Plesk Obsidian v18.0.54 on CentOS 7, and the current MySQL version is MariaDB 5.5.68 

    only for upgrading default MariaDB 5.5 to the MariaDB 10.5 version

    Since I cannot afford to mess anything up, I want to be crystal clear what you mean by "default" 5.5. Is this only 5.5.0? Would our 5.5.68 qualify for the Automatic Method above, or is Manual mode necessary? What's the likelihood of this failing and what would one do at that point? Reinstall 5.5.68 manually and import from backup?

    Thanks. I think twice before running significant command lines that could cost me many hours of precious time.

    0
  • Avatar
    Julian Bonpland Mignaquy

    Please go for the Manual Method, in case you hit any error you will know where it is.

    Since you are running 5.5 first upgrade to 10.5 and then repeat the procedure to 10.6 if you wish.

    0
  • Avatar
    Manos

    there were many many useful comments on this article over the years but disappeared

    Could you bring back?

    0
  • Avatar
    Joe Berry

    We had a bit of an issue on Ubuntu 18.04:

    root@x:~# curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | sudo bash -s -- --mariadb-server-version=10.4
    # [info] Checking for script prerequisites.
    # [warning] Found existing file at /etc/apt/sources.list.d/mariadb.list. Moving to /etc/apt/sources.list.d/mariadb.list.old_6
    # [info] MariaDB Server version 10.4 is valid
    # [info] Repository file successfully written to /etc/apt/sources.list.d/mariadb.list
    # [info] Adding trusted package signing keys...
    # [info] Running apt-get update...
    E: The repository 'https://dlm.mariadb.com/repo/maxscale/latest/apt bionic Release' does not have a Release file.
    # [error] Failed to add trusted package signing keys

     

    To fix this, we updated the repository file /etc/apt/sources.list.d/mariadb.list with an updated download URL for MariaDB, from their website https://mariadb.org/download/?t=repo-config. From this link, you will also be able to choose a version of MariaDB which is currently available to download, as 10.2 is no longer available even though it is specified in this article.

    # MariaDB 10.4 repository list - created 2023-08-30 13:03 UTC
    # https://mariadb.org/download/
    # deb.mariadb.org is a dynamic mirror if your preferred mirror goes offline. See https://mariadb.org/mirrorbits/ for details.
    # deb [signed-by=/etc/apt/keyrings/mariadb-keyring.pgp] https://deb.mariadb.org/10.4/ubuntu bionic main
    deb [signed-by=/etc/apt/keyrings/mariadb-keyring.pgp] https://mariadb.gb.ssimn.org/repo/10.4/ubuntu bionic main
    # deb-src [signed-by=/etc/apt/keyrings/mariadb-keyring.pgp] https://mariadb.gb.ssimn.org/repo/10.4/ubuntu bionic main

    Note that by copying this you will be using a UK Mirror Server to download the distribution. 

    Then running apt-get update and apt-get install mariadb-server should work. 

    0
  • Avatar
    Unnamed User

    Hai, i need tutorial for Almalinux 8.8 

    0
  • Avatar
    Julian Bonpland Mignaquy

    Hi Unnamed User, i used the instructions for Centos 8. I have updated the title with Almalinux 8. As for step 5 you can select the OS RHEL 8. (Almalinux is based on RHEL 8)

     

    0
  • Avatar
    Fulvio Varriale

    Is there also a guide for plesk servers with AlmaLinux 9.2?

    0
  • Avatar
    Julian Bonpland Mignaquy

    Hi Fulvio Varriale i have updated the article.

    0
  • Avatar
    Fulvio Varriale

    Thanks for the quick reply.

    I installed Maria DB 10.11 following all the steps you proposed.

    Unfortunately now it gives me a conflict message when I try to update (#yum update).

    Error:
     Problem 1: package mariadb-devel-3:10.5.16-2.el9_0.x86_64 conflicts with mysql-devel provided by MariaDB-devel-10.11.5-1.el9.x86_64
      - cannot install the best update candidate for package mariadb-devel-3:10.5.16-2.el9_0.x86_64
      - cannot install the best update candidate for package mariadb-connector-c-devel-3.2.6-1.el9_0.x86_64
     Problem 2: package mariadb-connector-c-doc-3.2.6-1.el9_0.noarch requires mariadb-connector-c = 3.2.6-1.el9_0, but none of the providers can be installed
      - package MariaDB-shared-10.11.5-1.el9.x86_64 obsoletes mariadb-connector-c provided by mariadb-connector-c-3.2.6-1.el9_0.x86_64
      - package MariaDB-shared-10.11.5-1.el9.x86_64 obsoletes mariadb-connector-c provided by mariadb-connector-c-3.2.6-1.el9_0.i686
      - cannot install the best update candidate for package mariadb-connector-c-doc-3.2.6-1.el9_0.noarch
      - cannot install the best update candidate for package mariadb-connector-c-3.2.6-1.el9_0.x86_64
     Problem 3: problem with installed package mariadb-connector-c-doc-3.2.6-1.el9_0.noarch
      - package mariadb-connector-c-doc-3.2.6-1.el9_0.noarch requires mariadb-connector-c = 3.2.6-1.el9_0, but none of the providers can be installed
      - package MariaDB-shared-10.11.5-1.el9.x86_64 obsoletes mariadb-connector-c provided by mariadb-connector-c-3.2.6-1.el9_0.x86_64
      - package MariaDB-shared-10.11.5-1.el9.x86_64 obsoletes mariadb-connector-c provided by mariadb-connector-c-3.2.6-1.el9_0.i686
      - cannot install the best update candidate for package mariadb-connector-c-config-3.2.6-1.el9_0.noarch
     Problem 4: problem with installed package mariadb-connector-c-devel-3.2.6-1.el9_0.x86_64
      - package mariadb-connector-c-devel-3.2.6-1.el9_0.x86_64 requires mariadb-connector-c = 3.2.6-1.el9_0, but none of the providers can be installed
      - package MariaDB-shared-10.11.3-1.el9.x86_64 obsoletes mariadb-connector-c provided by mariadb-connector-c-3.2.6-1.el9_0.x86_64
      - package MariaDB-shared-10.11.3-1.el9.x86_64 obsoletes mariadb-connector-c provided by mariadb-connector-c-3.2.6-1.el9_0.i686
      - package MariaDB-common-10.11.5-1.el9.x86_64 requires MariaDB-shared, but none of the providers can be installed
      - package MariaDB-shared-10.11.4-1.el9.x86_64 obsoletes mariadb-connector-c provided by mariadb-connector-c-3.2.6-1.el9_0.x86_64
      - package MariaDB-shared-10.11.4-1.el9.x86_64 obsoletes mariadb-connector-c provided by mariadb-connector-c-3.2.6-1.el9_0.i686
      - problem with installed package mariadb-devel-3:10.5.16-2.el9_0.x86_64
      - package mariadb-devel-3:10.5.16-2.el9_0.x86_64 conflicts with mysql-devel provided by MariaDB-devel-10.11.3-1.el9.x86_64
      - package mariadb-devel-3:10.5.16-2.el9_0.x86_64 conflicts with mysql-devel provided by MariaDB-devel-10.11.4-1.el9.x86_64
      - package mariadb-devel-3:10.5.16-2.el9_0.x86_64 conflicts with mysql-devel provided by MariaDB-devel-10.11.5-1.el9.x86_64
      - package MariaDB-shared-10.11.5-1.el9.x86_64 obsoletes mariadb-connector-c provided by mariadb-connector-c-3.2.6-1.el9_0.x86_64
      - package MariaDB-shared-10.11.5-1.el9.x86_64 obsoletes mariadb-connector-c provided by mariadb-connector-c-3.2.6-1.el9_0.i686
      - cannot install the best update candidate for package mariadb-common-3:10.5.16-2.el9_0.x86_64
    (try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

    In the Maria DB repo config "https://mariadb.org/download/?t=repo-config&d=Red+Hat+Enterprise+Linux+9&v=10.11&r_m=nextlayer" it was indicated below to install the component again via

    sudo dnf install MariaDB-server MariaDB-client

    Which I didn't do because I inserted the text you recommended "module_hotfixes=1" into the repo.

    Do I have to redo all the steps again and after saving the file follow the instructions from the MariaDB website?

    0
  • Avatar
    Julian Bonpland Mignaquy (Edited )

    Hi Fulvio Varriale , Please open a support ticket with us so we can investigate the issue https://support.plesk.com/hc/en-us/articles/12377663472791-How-to-submit-a-request-to-Plesk-support-

    0
  • Avatar
    Manos

    For almalinux the repo file you provided is wrong

     

    the correct is:

     

    [mariadb]
    name = MariaDB
    baseurl = http://yum.mariadb.org/10.6/rhel8-amd64
    gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
    gpgcheck=1
    priority=1
    module_hotfixes=1

    1
  • Avatar
    Glenn Es

    Please be careful if you are on AlmaLinux 9!
    If your databases are only reachable over 127.0.0.1 this might be your issue:
    https://talk.plesk.com/threads/almalinux-9-mariadb-10-5-to-10-6-then-after-mariadb-10-6-to-10-11.371140/

    I'ts fixable, but if you don't have to update I'd advise not to until https://jira.mariadb.org/browse/MDEV-30520 is resolved.

    0
  • Avatar
    Andrii Balytskyi

    On CentOS 7 also need run before start mariadb:

    install -dpm770 -o mysql -g mysql /var/run/mariadb
    0
  • Avatar
    Maarten

    Hi Plesk Support,

    Can you please remove the "sudo" command from the "Plesk on Debian 10/Debian 11" instructions?

    # curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | sudo bash -s -- --mariadb-server-version=10.4

    Debian has no sudo package installed by default, and it confuses people when it returns an error about the missing sudo command.

    See:
    https://talk.plesk.com/threads/mariadb-upgrade-10-3-10-6-not-working.371953/

    When you run the commands as root, there is no need for "sudo."


    Thanks!

    0
  • Avatar
    Julian Bonpland Mignaquy (Edited )

    Hi @Maarten

    During the OS installation , If you do not specify a password for the root user this account will be disabled but the sudo package will be installed later to enable administrative tasks to be carried out on the new system. -- from debian-installer/manual/en/howto/installation-howto.xml

    It seems that a root password was not specified during installation.
    All commands should be run as the root user.

     

    0
  • Avatar
    Raoul Volfoni

    Hi all,

    I upgraded MariaDB from version 10.3.39 to 10.6.15 and it went well. My only problem is that in Plesk it is always version 10.3.39 which appears in Tools Settings=>Database Servers.

    I successfully executed commands 12 and 13 of the tutorial for AlmaLinux8. Do you have a solution ?

    Many thanks

    0
  • Avatar
    Julian Bonpland Mignaquy

    Hi @Raoul, please run the following command and let me know: plesk bin service_node --update local

    0
  • Avatar
    Raoul Volfoni

    Hi Julian,

    Many thanks, that's perfect, version number updated. Have a nice day..

    0
  • Avatar
    Manos

    there were many many useful comments on this article over the years but disappeared

    Could you bring back?

    0
  • Avatar
    Julian Bonpland Mignaquy

    Hi Manos unfortunately older comments were not migrated when we transferred everything to the new system.

    0
  • Avatar
    xxxLesy

    The guide says MariaDB 10.11 in supported on latest Obsidian. Can/should we upgrade to 11.0 or 11.1? Or is this a no-no for now?

    0
  • 1
  • Avatar
    Sakisx

    I have MariaDB 10.3.39 and AlmaLinux 8.8

    Can I upgrade to 10.11 ?

    Shall I have to change something in "Plesk on CentOS 8/AlmaLinux 8/AlmaLinux 9" tutorial section ?

    0
  • Avatar
    Luis Talora (Edited )

    Hi, 

    Thanks for this guide. Could someone please answer 2 questions about the "Plesk on CentOS 8/AlmaLinux 8/AlmaLinux 9" procedure?

    • I see the procedure includes "galera-4" among the packages. Do I need it?
    • The AlmaLinux/CentOS 8 procedure stops the mariadb service and goes straight to the "yum install" command. Don't we need first to remove the current MariaDB version, as it is done on item 5 of the procedure for CentOS 7/RHEL 7 (through the command "rpm -e --nodeps `rpm -q --whatprovides mariadb-server`")?

    Thanks!

     

    0

Please sign in to leave a comment.

Have more questions? Submit a request