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

Follow

Comments

183 comments

  • Avatar
    Ivan Postnikov

    Hello Mark S.

    You may try the solution from here (you will need to adapt it to Deb 10 instead of Deb 8): https://unix.stackexchange.com/questions/339563/upgrade-mariadb-10-0-29maria-1jessie-failed

    In case this won't help, contact OS support.

    0
    Comment actions Permalink
  • Avatar
    Mark S.

    Thank you for your answer. Unfortunately the described method in your link (adapted to Debian Buster) does not work either.

    :-(

    0
    Comment actions Permalink
  • Avatar
    Anton Maslov

    Hello Mark,


    You may purchase an upgrade service from our Professional Services team:

    https://www.plesk.com/professional-services/administrative-services/

    0
    Comment actions Permalink
  • Avatar
    SamParis

    This command is missing to make it work.

    1°) Open the MariaDB configuration file

    DEBIAN vi /etc/mysql/mariadb.conf.d/50-server.cnf

    REDHAT vi /etc/my.cnf

    2°) Add the line below [mysqld] section:

    plugin-load-add = auth_socket.so

    SOURCE> https://support.plesk.com/hc/en-us/articles/360009592400-MariaDB-10-3-error-after-upgrade-Plugin-unix-socket-is-not-loaded

     

    0
    Comment actions Permalink
  • Avatar
    Philipp Lang (Edited )

    Is there any reason why this is not done in the course of a normal plesk update? I have 18.0 Obsidian installed - which supports MariaDb 10.3 natively - but this has never been updated since the first installation of the server. 

    As this also seems really verbose - is this still the recommended way for all versions? I mean why isn't it possible to upgrade this via Plesk Updates like any other 3rd party package?

    0
    Comment actions Permalink
  • Avatar
    Dr. Michael Gellner

    Sorry - this becomes annoying.

    Plesk writes that Moodle is a supported application - but today even a fresh install on a fresh system (Ubutu 18.04) is impossible. Again the famous non zero exit.

    Again the mariaDB version is too old. That's why at the beginning of the week my former debian server became unusable for moodle. Since days I try and try THESE linux hacking rubbish that don't want to apply. Now I sit in front of my fresh Ubuntu system with the same missing Moodle in these remote corona days and waste day after day with this mariaDB shit! 

    Please: ONE BUTTON, ONE UPDATE as it should be for Plesk users! Six pages reading tricks with endless links to source of sources to sources - sorry, NO!

    If Plesk supports Moodle I expect a real Plesk update without this not working hacks. Otherwise remove Moodle from the compatibility list. At the moment it neither be used nor installed. And that's the last thing I (and I guess a lot of others either) can need in these distancing days. Sorry for being a little harsh, but working help is needed urgently. And no: this is nothing for an additional purchasing of any Service. If the DB update will do as it should we would be done.

    Thanks 

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

    Hello Philipp Lang

    Thank you for the feedback. By design, MariaDB/MySQL server is installed from OS repositories unless custom isn't specified. 10.3 Maybe be installed with new Plesk Obsidian in case correct repos are set up on the server.

    > is this still the recommended way for all versions? 

    Yes, indeed, this is the only way to have MariaDB/MySQL. As long as you follow the process for your OS step by step, the process should go smoothly. 

    Feel free to vote for this feature suggestion: https://plesk.uservoice.com/forums/184549-feature-suggestions/suggestions/6315581-multiple-mysql-versions-configureable-over-panel

    0
    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    Hello Dr. Michael Gellner

    Sorry for the long response and thank you for the feedback.

    To be honest, on your side I would feel the same.

    However, the only way to satisfy the requirements is to do the steps from this article manually.

    Usually, the process goes smoothly.

    If now you're stuck with some particular error, let us know, maybe some Pleskian already has a solution.

    0
    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    Hello SamParis

    Thank you for noticing.

    According to https://jira.mariadb.org/browse/MDEV-14367 this happens when updating from MariaDB 10.1.

    However, this still may be useful for other Pleskians.

    0
    Comment actions Permalink
  • Avatar
    Richard Anthony Secor (Edited )

    mariadb105 is missing in install-mysql ...

    # /usr/share/lve/dbgovernor/mysqlgovernor.py --mysql-version=mariadb105

    install-mysql: error: argument --mysql-version: invalid choice: 'mariadb105' (choose from 'auto', 'mysql51', 'mysql55', 'mysql56', 'mysql57', 'mysql80', 'mariadb55', 'mariadb100', 'mariadb101', 'mariadb102', 'mariadb103', 'mariadb104', 'percona56')

    Looks like a CloudLinux issue.
    MariaDB v 10.5 is not there yet
    1
    Comment actions Permalink
  • Avatar
    Anton Maslov

    Richard Anthony Secor Hi Richard, you are right. MariaDB 10.5 is not yet added to mysql-governor by CloudLinux .

    0
    Comment actions Permalink
  • Avatar
    Jan Bludau (Edited )

    Hello Plesk Support Team,

    could you change this line in your documentation:

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

    to

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

    it shows what is happening. Better output better for large Databases doesn't seems to be frozen.

    0
    Comment actions Permalink
  • Avatar
    Andreu

    Hello,
    I am trying to upgrade to mariadb 10.4 from Plesk Obsidian 18.0.30 on debian 9 and after adding the command # curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash -s -- --mariadb-server-version=mariadb-10.4 get the following error: curl: (23) Failed writing body (395 != 1369)
    What could this be due to?

    Thank you

    0
    Comment actions Permalink
  • Avatar
    Julian Bonpland Mignaquy

    Andreu Hi! on my debian 9 server it works fine. Which curl version are you running? My test server is running:

    # curl -V
    curl 7.52.1

     

    Please open a support ticket with us so we can take a look.

    0
    Comment actions Permalink
  • Avatar
    Julian Bonpland Mignaquy

    Jan Bludau Done :)

    0
    Comment actions Permalink
  • Avatar
    Learning Curve

    Hi, it's only a minor point, but can the guidance notes for Ubuntu 18.04, which appear to be out of date (image) be corrected / updated? MariaDB 10.3.* is supported from Plesk Obsidian (any release) and MariaDB 10.4.* / 10.5.* are both now supported from Obsidian 18.0.30 release onwards. In addition, Ubuntu 20.04 OS is completely missing, yet that is now supported from Obsidian 18.0.29 release onwards too.

    0
    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    Hello Learning Curve

    Thank you for the comment.

    The article was updated. Let us know in case you have something to add.

    1
    Comment actions Permalink
  • Avatar
    Markus (Edited )

    Hi amazing Plesk support,

    in the past all upgrades were successful. This time it seems also, but in the end of installation MariaDB 10.5.5 to 10.3.24 on Ubuntu 18.04.5 and Plesk Obsidian 18.0.30 #1 I got the info that the installation failed. I went on for the last three steps by restarting and updating package version in Plesk. Then I looked in Plesk and the old version 10.3.x was shown. I performed the usual step clicking on localhost and simply clicking on OK on the next side.

    Then the new 10.5.5 version of MariaDB was shown and all websites/databases are working.

    But the fatal error already makes me unsure. Is everything okay now, or not.

    Greets and thanks for the tutorial.


    root@server:~# service mariadb start
    root@server:~# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql_upgrade -uadmin
    Phase 1/7: Checking and upgrading mysql database
    Processing databases
    mysql
    mysql.column_stats OK
    mysql.columns_priv OK
    mysql.db OK
    mysql.event OK
    mysql.func OK
    mysql.global_priv OK
    mysql.gtid_slave_pos OK
    mysql.help_category OK
    mysql.help_keyword OK
    mysql.help_relation OK
    mysql.help_topic OK
    mysql.index_stats OK
    mysql.innodb_index_stats OK
    mysql.innodb_table_stats OK
    mysql.plugin OK
    mysql.proc OK
    mysql.procs_priv OK
    mysql.proxies_priv OK
    mysql.roles_mapping OK
    mysql.servers OK
    mysql.table_stats OK
    mysql.tables_priv OK
    mysql.time_zone OK
    mysql.time_zone_leap_second OK
    mysql.time_zone_name OK
    mysql.time_zone_transition OK
    mysql.time_zone_transition_type OK
    mysql.transaction_registry OK
    Phase 2/7: Installing used storage engines... Skipped
    Phase 3/7: Fixing views
    mysql.user
    Error : The user specified as a definer ('mariadb.sys'@'localhost') does not exist
    error : Corrupt
    Phase 4/7: Running 'mysql_fix_privilege_tables'
    ERROR 1449 (HY000) at line 7: The user specified as a definer ('mariadb.sys'@'localhost') does not exist
    ERROR 1449 (HY000) at line 16: The user specified as a definer ('mariadb.sys'@'localhost') does not exist
    ERROR 1449 (HY000) at line 59: The user specified as a definer ('mariadb.sys'@'localhost') does not exist
    ERROR 1449 (HY000) at line 68: The user specified as a definer ('mariadb.sys'@'localhost') does not exist
    ERROR 1449 (HY000) at line 86: The user specified as a definer ('mariadb.sys'@'localhost') does not exist
    FATAL ERROR: Upgrade failed
    root@server:~# service mariadb restart
    root@server:~# plesk bin service_node --update local
    The service node 'local' was successfully updated.
    root@server:~# plesk sbin packagemng -sdf
    root@server:~#

    root@server:~# aptitude upgrade
    The following packages will be upgraded:
    libmariadb3 mysql-common
    2 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    Need to get 153 kB of archives. After unpacking 3,072 B will be used.
    Do you want to continue? [Y/n/?] Y
    Get: 1 http://mirror.truenetwork.ru/mariadb/repo/10.5/ubuntu bionic/main amd64 libmariadb3 amd64 1:10.5.5+maria~bionic [149 kB]
    Get: 2 http://mirror.truenetwork.ru/mariadb/repo/10.5/ubuntu bionic/main ppc64el mysql-common all 1:10.5.5+maria~bionic [3,264 B]
    Fetched 153 kB in 1s (267 kB/s)
    (Reading database ... 220626 files and directories currently installed.)
    Preparing to unpack .../libmariadb3_1%3a10.5.5+maria~bionic_amd64.deb ...
    Unpacking libmariadb3:amd64 (1:10.5.5+maria~bionic) over (1:10.3.24+maria~bionic) ...
    Preparing to unpack .../mysql-common_1%3a10.5.5+maria~bionic_all.deb ...
    Unpacking mysql-common (1:10.5.5+maria~bionic) over (1:10.3.24+maria~bionic) ...
    Setting up libmariadb3:amd64 (1:10.5.5+maria~bionic) ...
    Setting up mysql-common (1:10.5.5+maria~bionic) ...
    Processing triggers for mariadb-server-10.5 (1:10.5.5+maria~bionic) ...
    Processing triggers for libc-bin (2.27-3ubuntu1.2) ...

    Current status: 0 (-2) upgradable.
    root@server:~#

    root@server:~# service mariadb status
    ● (<green) mariadb.service - MariaDB 10.5.5 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, override.conf
    Active: active (running) since Tue 2020-09-22 22:49:35 CEST; 50min ago
    Docs: man:mariadbd(8)
    https://mariadb.com/kb/en/library/systemd/
    Main PID: 22381 (mariadbd)
    Status: "Taking your SQL requests now..."
    Tasks: 22 (limit: 4915)
    CGroup: /system.slice/mariadb.service
    └─22381 /usr/sbin/mariadbd

    Sep 22 22:49:33 server.example.com systemd[1]: Starting MariaDB 10.5.5 database server...
    Sep 22 22:49:33 server.example.com mariadbd[22381]: 2020-09-22 22:49:33 0 [Note] /usr/sbin/mariadbd (mysqld 10.5.5-MariaDB-1:10.5.5+maria~bion
    Sep 22 22:49:35 server.example.com systemd[1]: Started MariaDB 10.5.5 database server.
    Sep 22 22:49:35 server.example.com /etc/mysql/debian-start[22410]: Upgrading MySQL tables if necessary.
    Sep 22 22:49:35 server.example.com systemd-journald[529]: Suppressed 2385 messages from mariadb.service
    Sep 22 22:49:35 server.example.com /etc/mysql/debian-start[22415]: /usr/bin/mysql_upgrade: the '--basedir' option is always ignored
    Sep 22 22:49:35 server.example.com /etc/mysql/debian-start[22415]: Looking for 'mysql' as: /usr/bin/mysql
    Sep 22 22:49:35 server.example.com /etc/mysql/debian-start[22415]: Looking for 'mysqlcheck' as: /usr/bin/mysqlcheck
    Sep 22 22:49:35 server.example.com /etc/mysql/debian-start[22415]: This installation of MariaDB is already upgraded to 10.5.5-MariaDB, use --f
    Sep 22 22:49:35 server.example.com /etc/mysql/debian-start[22423]: Checking for insecure root accounts.
    lines 1-23/23 (END)

    0
    Comment actions Permalink
  • Avatar
    Anton Maslov (Edited )

    Hello Markus

    MariaDB upgrade to 10.5 with Ubuntu 18 was not yet tested. Please note that MariaDB upgrade is system administrative task. You may want to contact MariaDB Community support or wait for the article to be updated with steps for Ubuntu 18 and upgrade to 10.5

    0
    Comment actions Permalink
  • Avatar
    Learning Curve (Edited )

    Hello Ivan Postnikov

    Thank you very much. That's already much clearer than it was previously. Additional comments are:

    The warning about which Obsidian releases are suitable for which MariaDB releases is included in the Ubuntu 20.04 guide, but is missing from the Ubuntu 18.04 guide (image). It's therefore, still possible for somebody... using Ubuntu 18.04 to make a wrong assumption, as a result of that missing warning.

    The Plesk Changelog implies, but does not actually state, that MariaDB 10.4.* / 10.5.* are both now supported for all OS, from the Obsidian 18.0.30 release onwards (image) although, this page, is then given as the link for more detailed guidance. Users should therefore, come here to check & verify their own setup / intentions in advance. That's very good, but users are users, so it's not guarenteed!

    However, the last post from Anton Maslov then states "MariaDB upgrade to 10.5 with Ubuntu 18 was not yet tested" That's the ONLY reference for Ubuntu 18.04 users of this current status, anywhere on this page...i.e. That's not shown in the guide. This may also be the case for a MariaDB upgrade to 10.4.*  for Ubuntu 18.04 users.? Nobody knows, because it's not (yet) clearly stated anywhere in any guidance notes & not all users will read this comments section first. Therefore, there is still an unstated risk at this stage.

    FWIW, We currently use Ubuntu 18.04 LTS and we have had no problems at all, with the last two MariaDB upgrades within Plesk, when using this page for guidance. Now though, we can't yet / won't upgrade from MariaDB 10.3.* to MariaDB 10.4.* and/or MariaDB 10.5.*, becasue there's no confirmation from Plesk in the guideance section, well not yet :o)) that either of these upgrades will be fully successful (which means previously, they have actually been tested & verified by Plesk themselves)

    There's no need to publish this comment, as it's aimed purely for yourself Ivan Postnikov but it is much better for all concerned, if these missing details are very quickly added, because as you know MariaDB downgrades don't work / are not reccomended even by MariaDB themselves.

    Some Plesk users, who don't read any comments & only read the guidance sections on this page, if, they haven't taken a server snapshot backup or similar, prior to their MariaDB upgrade process, might inadvertently, make their own server and Plesk installation, totally unusable and irrecoverable.

    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
    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
    Markus

    Thanks a lot for answering, Anton Maslov. It's too late. I already performed the upgrade, seems to be successful. I performed the steps from the tutorial above. Apart from the install notice "Fatal error..." everything is running fine on 10.5.5. I had the same problem by upgrading from 10.2 to 10.3. So, if nothing bad will happen I'll run it until I change my server next year after three/four years.

    Greets

    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
    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
    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
    Anzhelika Khapaknysh

    @Sebastian Ayala,

    From the provided logs it looks that the previous version of MySQL wasn't removed properly.
    Please make sure that all steps from the guide were completed successfully.

    If not, feel free to submit the ticket to our Support Team.

    0
    Comment actions Permalink
  • Avatar
    Learning Curve

    There maybe some speciifc fine details in the above guide for Ubuntu 18.04, that have yet to be added (at the time of this note; 13/10) but after some external research and some advance consulation with Plesk, we ran the upgrade process from MariaDB 10.3.* to 10.4.* and that went very smoothly. No issues, faults, warnings or errors when testing afterwards.

    We then, ran the upgrade process from MariaDB 10.4.* to MariaDB 10.5.* . Yes we could have just run the upgrade process from MariaDB 10.3.* to MariaDB 10.5.* and just omitted MariaDB 10.4.*, but one major release at a time, gave a much better recovery position (recoverable cloud server snapshot) if one was needed.

    Compared to previous releases, there are a few subtle MariaDB changes in MariaDB 10.5.* though, e.g.

    "...From MariaDB 10.4.6, mariadb is available as a symlink to mysql.
    From MariaDB 10.5.2, mysql is the symlink, and mariadb the binary name..."

    Plus, depending on your own install process choices, others things, including say; /etc/mysql/mariadb.cnf and etc/logrotate.d/mysql-server may need attention afterwards, but, Plesk were helpful in advance, so after some 'fine tuning' following the final upgrade; the Ubuntu 18.04.5 LTS / Obsidian 18.0.30 / MariaDB 10.5.6 combination is running like clockwork, with no issues, faults, warnings or errors. It was worth the effort.

     

     

    0
    Comment actions Permalink

Please sign in to leave a comment.

Have more questions? Submit a request