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
    Julian Bonpland Mignaquy

    Jan Bludau Done :)

    0
    Comment actions Permalink
  • Avatar
    Alexander Hammer (Edited )

    Dear Ivan,

    thanks for pointing out the easy way to disable the repo.

    When login into the server back-end this morning. Plesk wants to update the MySQL server! When I go to the Plesk page: "available updates", it shows me the following updates:

    MariaDB-client 10.2.27-1.el7.centos (mariadb) MariaDB: to 10.2.28-1.el7.centos aktualisieren (mariadb)
    MariaDB-common 10.1.42-1.el7.centos (mariadb) MariaDB: to 10.2.28-1.el7.centos aktualisieren (mariadb)
    MariaDB-server 10.2.27-1.el7.centos (mariadb) MariaDB: to 10.2.28-1.el7.centos aktualisieren (mariadb)
    MariaDB-shared 10.1.42-1.el7.centos (mariadb) MariaDB: to 10.2.28-1.el7.centos aktualisieren (mariadb)

    How do I get rid of this? Because when running der yum update on cli, it shows that there are no updates.

    The version installed is:
    [root@example ~]# rpm -q --whatprovides mysql-server
    MariaDB-server-10.2.27-1.el7.centos.x86_64
    MariaDB-server-10.2.27-1.el7.centos.x86_64

    thx Alexander

    0
    Comment actions Permalink
  • Avatar
    Sebastian Ayala

    I have this error:

     

    file /usr/share/mysql/charsets/Index.xml from install of MariaDB-common-10.3.24-1.el8.x86_64 conflicts with file from package mysql-common-8.0.21-1.module_el8.2.0+493+63b41e36.x86_64
    file /usr/share/mysql/charsets/armscii8.xml from install of MariaDB-common-10.3.24-1.el8.x86_64 conflicts with file from package mysql-common-8.0.21-1.module_el8.2.0+493+63b41e36.x86_64...

    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
    Dryx Emerson

    After upgrade there is an error when Im creating database

     

    "error: Connection to the database server failed: The user specified as a definer ('root'@'localhost') does not exist plesk"

    0
    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    Mark S.

    Instructions for Debian 10 were added.

    Sid B

    Typically /etc/yum.repos.d/ exists on CentOS server. Try creating the directory and file MariaDB.repo

    Permissions for yum.repos.d:
    drwxr-xr-x 2 root root 

    For MariaDB.repo:

    -rw-r--r-- 1 root root ... MariaDB.repo

    Also, we have a team which does such tasks for server owners on a paid basis: https://www.plesk.com/professional-services/administrative-services/ 

    0
    Comment actions Permalink
  • Avatar
    Sid B

    We have Obsidian 18.0.30  on Centos 7.8  and mariadb 5.65 (which is running) and yum

    BUT the directory /etc/yum.repos.d/ does not exist NOR does the file MariaDB.repo in fact

    we can't find that file anywhere on our dedicated server!

    So the instructions for Centos 7 just don't work??

     

    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
    Jan Bludau

    i've read the changelog nothing spezial there ... ok it was risky but its my development and test-server where i did it... mariabdb 10.4 works very well.

    Some advantages are:

    DoS Protection
    Bruteforce Detection

    Plesk should support the newest version officially.

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

    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
  • Avatar
    Mark S.

    Can you also add Debian (10) Buster above? MariaDB update to 10.4 worked without complications. Unfortunately it is not clear from the article of MariaDB (DEB-files) if an update to version 10.5 under Debian Buster is also possible.

    Greetings

    0
    Comment actions Permalink
  • Avatar
    Learning Curve

    For Information (may be useful to some other users). At the time of making this specific post, we're now running: Ubuntu 18.04.3 LTS / Plesk onyx 17.8.11 / MariaDB 10.3.17 with no issues or problems (Plesk or MariaDB)

    We needed to upgrade from MariaDB 10.2.* to MariaDB 10.3.* for some of the domains that we host, due to the software they run. Not wanted... Needed! Yes MariaDB 10.2.* is still a stable MariaDB release, but is too old now for some applications, plus MariaDB 10.3.* & MariaDB 10.4.* specifically, offer lots more improved functionality.

    Waiting for Plesk Obsidian to finally be released at 'early adopter' status was/is still not an option for us. FWIW If Obsidian is NOT released c/w full Plesk support for MariaDB 10.4.* then serious questions need to be asked!! Plesk avoiding 'officially supporting' latest, stable releases, mainly, due to lack of advance testing time? Hmmm

    Back to the MariaDB 10.2.* to MariaDB 10.3.* upgrade. We posted a Plesk support ticket to try and treble check everything that we could in advance and the support team were extremely helpful. We ran the upgrade, tested everything, then restored a snapshot to take the server back to the Pre-MariaDB upgrade status. We then asked more specific questions (all of which, again, were very helpfully answered by the support team) but then we waited for the next Plesk 17.8.11 update before proceeding any further. Why? That's becasue we wanted to upgrade MariaDB, but, also, wanted to then test that setup by running a Plesk update too, before taking anything / everything live. That we did & there were no issues. The Plesk 17.8.11 update on our Ubuntu 18.04.3 LTS / MariaDB 10.3.17 setup ran perfectly, with no problems, which was nice & this completed our pre-live testing.

    MariaDB 10.3.* on Plesk 17.8.11 is still not 'offcially supported' (and most likely, never will be now) but on our current server / domains / software setup it's all good & fingers crossed, we're satisfied with everything so far!

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

    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
    Victor Ma

    Hi Great guys,

    I install Mysql in the  AWS linux server, it is version mysql Ver 15.1 Distrib 5.5.68-MariaDB, for Linux (x86_64) using readline 5.1  (exported by Mysql -V).

    But I want upgrade 5.5.68-MariaDB to 10.3+ MarinaDB . In my server has no /etc/psa/.psa.shadow  folder and file. I tried to run the commands but there are many error. Could you tell me what I should to do please ? Thank you so much !

    error :

    ---> Package socat.x86_64 0:1.7.3.2-2.amzn2.0.1 will be installed
    --> Finished Dependency Resolution
    Error: Package: MariaDB-client-10.4.17-1.el8.x86_64 (mariadb)
    Requires: libc.so.6(GLIBC_2.28)(64bit)
    Error: Package: MariaDB-server-10.4.17-1.el8.x86_64 (mariadb)
    Requires: libc.so.6(GLIBC_2.28)(64bit)
    Error: Package: MariaDB-shared-10.4.17-1.el8.x86_64 (mariadb)
    Requires: libc.so.6(GLIBC_2.28)(64bit)
    Error: Package: galera-4-26.4.6-1.el8.x86_64 (mariadb)
    Requires: libboost_program_options.so.1.66.0()(64bit)
    Error: Package: MariaDB-backup-10.4.17-1.el8.x86_64 (mariadb)
    Requires: libc.so.6(GLIBC_2.28)(64bit)
    Error: Package: MariaDB-server-10.4.17-1.el8.x86_64 (mariadb)
    Requires: libcrypt.so.1(XCRYPT_2.0)(64bit)
    Error: Package: MariaDB-backup-10.4.17-1.el8.x86_64 (mariadb)
    Requires: libcrypt.so.1(XCRYPT_2.0)(64bit)
    Error: Package: MariaDB-client-10.4.17-1.el8.x86_64 (mariadb)
    Requires: libcrypt.so.1(XCRYPT_2.0)(64bit)
    Error: Package: MariaDB-server-10.4.17-1.el8.x86_64 (mariadb)
    Requires: libsepol >= 2.8-2.el8
    Installed: libsepol-2.5-8.1.amzn2.0.2.x86_64 (installed)
    libsepol = 2.5-8.1.amzn2.0.2
    Available: libsepol-2.5-6.amzn2.x86_64 (amzn2-core)
    libsepol = 2.5-6.amzn2
    Available: libsepol-2.5-8.1.amzn2.i686 (amzn2-core)
    libsepol = 2.5-8.1.amzn2
    You could try using --skip-broken to work around the problem
    You could try running: rpm -Va --nofiles --nodigest
    [

     

     

     

     

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

    0
    Comment actions Permalink
  • Avatar
    Anastasia Zyrianova

    Hello giuseppe amodio,

    Thank you for your comment. I've re-tested the script on a test server. It is possible to execute it as Superuser using the 'sudo ./c7-mariadb-10.5-upgrade.sh' command. 
    So the following statement from the article is correct:

    To start an upgrade of MySQL/MariaDB, connect to a server via SSH as root/superuser and follow the instructions for your operating system:

     

    0
    Comment actions Permalink
  • Avatar
    maartenv

    There is an error in the attached script.
    This doesn't do anything, the files and directories are copied to /dev/null

    echo "creating backup of mysql directory"
    cp -v -a /var/lib/mysql/ /var/lib/mysql_backup 2&> /dev/null

    It should be something like this, copying the errors to /dev/null

    echo "creating backup of mysql directory"
    cp -v -a /var/lib/mysql/ /var/lib/mysql_backup 2> /dev/null

    0
    Comment actions Permalink
  • Avatar
    Javier Cota

    The upgrade script link is broken for CentOS 7

     

    [root@srvr ~]# wget https://plesk.zendesk.com/hc/article_attachments/360022419980/mariadb-10.5-upgrade.sh && chmod +x mariadb-10.5-upgrade.sh
    --2022-03-08 21:18:39--  https://plesk.zendesk.com/hc/article_attachments/360022419980/mariadb-10.5-upgrade.sh
    Resolving plesk.zendesk.com (plesk.zendesk.com)... 104.16.51.111, 104.16.53.111
    Connecting to plesk.zendesk.com (plesk.zendesk.com)|104.16.51.111|:443... connected.
    HTTP request sent, awaiting response... 404 Not Found
    2022-03-08 21:18:40 ERROR 404: Not Found.

    Can someone please provide the updated link?

    0
    Comment actions Permalink
  • Avatar
    Anastasia Zyrianova

    Hello Javier Cota,

    The link was updated. Thank you for bringing it to our attention!

    0
    Comment actions Permalink
  • Avatar
    Henk Bartels

    Hello Michael,

    I have the exact same problem when trying to update MySql (MariaDB).
    Unable to remove the old SQL version....

    I hope that if you find a solution, you will put it here.

     

    Henk

    0
    Comment actions Permalink
  • Avatar
    Peter Debik

    If I remember correctly, the "exclude=MariaDB" resulted from a situation where an automatic update updated MariaDB to a version that failed with certain database attributes and was shortly revoked after publication. At that time the advice was to exclude MariaDB from automatic updates (from Yum respectively). So indeed, this is an "extra" user-driven configuration that is not the MariaDB or Yum default.

    0
    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    Hello @Steve,

    Thank you for the information.

    0
    Comment actions Permalink
  • Avatar
    Anastasia Zyrianova

    Hello Carlos Lopez,

    To update to MariaDB 10.6 on Centos 7 you will need to apply the Manual Solution for Centos 7. In step 6 it will be required to open the Setting MariaDB repositories page, select your OS distro, release, and desired MariaDB version, and place the provided output to the `/etc/yum.repos.d/MariaDB.repo` file as per steps 6.1 and 6.2.

     

    0
    Comment actions Permalink
  • Avatar
    Peter Debik

    Serverplan Plesk

    What exactly did not work, e.g. what error messages have been displayed? Was "yum clean all" your solution?

    0
    Comment actions Permalink
  • Avatar
    Steve Yates

    Hi Julian,

    Are you on CentOS 7?  Maybe something changed recently then.  The last few times I've installed updates they go in and create the file.  A few months later, maybe, we install a kernel update and restart the server.  Even after that the "mysql" service is running and is MariaDB like I said, so I don't immediately notice anything wrong.  But we have a nightly script that runs "/bin/systemctl stop mariadb.service" and "/bin/systemctl start mariadb.service" to copy the raw MySQL files (in addition to an export), and the start fails because "mysql" is already running.  It caught me a couple times in the past year, so I thought I'd post about it for others.

    0
    Comment actions Permalink
  • Avatar
    Michael

    I am unable to upgrade from MariaDB 10.1 to 10.2. I get this error:

    This is a brief description of the upgrade process. Important details
    can be found in the MariaDB manual, in the Upgrading section.
    ******************************************************************
    error: %pre(MariaDB-server-10.2.41-1.el7.centos.x86_64) scriptlet failed, exit status 1
    Error in PREIN scriptlet in rpm package MariaDB-server-10.2.41-1.el7.centos.x86_64
    MariaDB-server-10.1.48-1.el7.centos.x86_64 was supposed to be removed but is not!
    Verifying : MariaDB-server-10.1.48-1.el7.centos.x86_64 1/2
    Verifying : MariaDB-server-10.2.41-1.el7.centos.x86_64 2/2

    Failed:
    MariaDB-server.x86_64 0:10.1.48-1.el7.centos MariaDB-server.x86_64 0:10.2.41-1.el7.centos

    Complete!

    Anyone has any ideas?

    0
    Comment actions Permalink
  • Avatar
    Carlos Lopez

    Hello,

    What do I need to change to upgrade to 10.6 on CentOs 7?

    Thanks in advance.

    0
    Comment actions Permalink
  • Avatar
    Sylvio

    Hi on Ubuntu 18.04 bionic... I followed your procedure and had 2 issues :
    1) mirror.truenetwork.ru is not responding, I used sfo1.mirrors.digitalocean.com instead (found on mariadb.com)
    2) apt-get install gave me : "mariadb-server : Depends: mariadb-server-10.5" "Unable to correct problems, you have held broken packages". I googled and solved this by :

    curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash
    apt update
    apt upgrade
    apt remove mysql-common
    apt install mariadb-server

    found on stackoverflow.com.

    Then after first start of mariadb service I had 2 errors messages, but this was only for the first start before the end of the procedure... finger cross ;-)

    0
    Comment actions Permalink

Please sign in to leave a comment.

Have more questions? Submit a request