How to upgrade MySQL 5.5 to 5.6/5.7 or MariaDB 5.5 to 10.0/10.1/10.2 on Linux?

Follow

Comments

121 comments

  • Avatar
    Alexey Lapshin

    Hello @Rashid.
    Please make sure that /etc/yum.repos.d/MariaDB.repo contained the following line:
    baseurl = http://yum.mariadb.org/10.2/centos7-amd64
    and repeat the installation.

    If you still unable to install MariaDB 10.x - submit a ticket to us https://support.plesk.com/hc/en-us

    0
    Comment actions Permalink
  • Avatar
    Steve Yates

    re: the CentOS 7 instructions:  "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"

    ...it is my experience that running "yum update" and having it install updates to MariaDB 10.2 recreates the file /etc/init.d/mysql.  At the next boot the "mysql" service (which is MariaDB) will start, and any scripts that try to stop and start mariadb may fail since mariadb is "not running" even though it is under the other service name.  In other words /etc/init.d/mysql would need to be deleted after installing updates.

    0
    Comment actions Permalink
  • Avatar
    Julian Bonpland Mignaquy

    @Steve Yates

    I was able to check what you mentioned after upgrading to MariaDB 10.2.1. After running "yum updates" (to get to 10.2.25) the file /etc/init.d/mysql was recreated but it did not affect the service after reboot. After I rebooted, mariadb was running and mysql was not.

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

    @Steve Yates

    I tested on CentOS 7 and tried the same thing as you and MariaDB service does not fail. I recommend opening a ticket with our support team.

    0
    Comment actions Permalink
  • Avatar
    Steve Yates

    Hi Julian, finally got around to installing updates.  Updated 3 Plesk servers tonight that had MariaDB 10.2.  One did not have /etc/init.d/mysql, but the other two did, both files dated June 14.  One of those had MariaDB 10.2.24 installed June 21, the other on June 19.  I updated all (yum update) and none of the three had file /etc/init.d/mysql afterwards.  Maybe MariaDB changed/fixed the update, who knows.  I'll let it go for now and maybe open a ticket if it ever recurs.

    0
    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    Hello @Steve,

    Thank you for the information.

    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
    Maxim Krasikov

    Hi @Christopher-James Sheppard,

    There is no solution to roll-back MySQL to the previous version. In case of the upgrade failure, it is necessary to find the cause of the failure and finish the upgrade.

    Please note that it is strongly recommended to create a server snapshot before initializing MySQL upgrade just in case.

    Also, if you prefer that the upgrade is performed by Plesk professionals, I suggest you contact our Professional Services Team and discuss this task with them: https://www.plesk.com/professional-services/ . In this case, it will be performed on a paid basis.

    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
    Omotere Lanre Ebenezer

    This article solved my problem, thanks.

    0
    Comment actions Permalink
  • Avatar
    Rashid Siddiqui

    Using Plesk ONYX and CENTOS 7 I had previously upgraded to MariaDB 10.2 with the help of this post. Now I have installed Plesk Obsidian and wanted to upgrade to MariaDB 10.3 since it's compatible, and I was wondering if the procedure to do that would be the same as described here or I need to refer to another procedure to upgrade to MariaDB 10.3 on Obsidian. Will appreciate information.

    1
    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    Hello @Rashid,

    The procedure is the same.

    Also, recommend making the server snapshot before the upgrade in case something goes wrong.

    1
    Comment actions Permalink
  • Avatar
    Robert

    I updated from mairadb 10.2 to 10.3 with the updated plesk 18x 
    Unfortunately i cant connect to ODBC anymore. 

    /etc/mysql/my.cnf  still has bind-address = 0.0.0.0   

    I followed https://support.plesk.com/hc/en-us/articles/115002983385-Unable-to-connect-remotely-to-MySQL-on-a-Plesk-server-Connection-refused
     
    how to get this back?

    0
    Comment actions Permalink
  • Avatar
    zainee123

    @Robert. Thanks a lot. This is really a helpful information.

    Regards

    0
    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    @Robert

    Additional investigation is required.

    As I can see, you've previously had tickets submitted to us, please create a ticket regarding this issue.

    0
    Comment actions Permalink
  • Avatar
    Hopjanj (Edited )

    Hello,

    After upgrading to MariaDB 10.2 I have mysql warning in my log.

    ...
    2019-10-25 9:08:08 139900448986880 [Warning] InnoDB: Cannot add field `external_id` in table `psa`.`clients` because after adding it, the row size is 8714 which is greater than maximum allowed size (8126) for a record on index leaf page.
    2019-10-25 9:08:14 139900448782080 [Warning] InnoDB: Cannot add field `page_wrapper_template` in table `admin_d_db`.`IPB_cms_pages` because after adding it, the row size is 8858 which is greater than maximum allowed size (8126) for a record on index leaf page.
    2019-10-25 9:08:22 139900448986880 [Warning] InnoDB: Cannot add field `page_wrapper_template` in table `admin_db`.`IPB_cms_pages` because after adding it, the row size is 8858 which is greater than maximum allowed size (8126) for a record on index leaf page.
    2019-10-25 9:08:27 139900448782080 [Warning] InnoDB: Cannot add field `category_last_title` in table `admin_db`.`IPB_cms_database_categories` because after adding it, the row size is 8766 which is greater than maximum allowed size (8126) for a record on index leaf page.
    2019-10-25 9:08:46 139900448782080 [Warning] InnoDB: Cannot add field `country` in table `admin_whmc1`.`tblclients` because after adding it, the row size is 8690 which is greater than maximum allowed size (8126) for a record on index leaf page.
    2019-10-25 9:10:01 139900449396480 [Warning] InnoDB: Cannot add field `record_edit_member_name` in table `admin_d_db`.`IPB_cms_custom_database_1` because after adding it, the row size is 8152 which is greater than maximum allowed size (8126) for a record on index leaf page.
    2019-10-25 9:13:36 139900449396480 [Warning] InnoDB: Cannot add field `video_poster` in table `admin_d_db`.`IPB_videos_videos` because after adding it, the row size is 8754 which is greater than maximum allowed size (8126) for a record on index leaf page.
    2019-10-25 9:17:02 139900447553280 [Warning] InnoDB: Cannot add field `month` in table `psa`.`ScheduledTasks` because after adding it, the row size is 8567 which is greater than maximum allowed size (8126) for a record on index leaf page.

    Should I edit my.cnf?
    If so, what are the optimum values?

    OS: Ubuntu 18.04.3 LTS
    Plesk Obsidian 18.0.20

    Thank You for Answer

     

     

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

    Dryx Emerson please take a look at the following article https://support.plesk.com/hc/en-us/articles/213409469-Database-backup-in-Plesk-fails-because-of-missing-MySQL-user-The-user-specified-as-a-definer-does-not-exist

    And also make sure that you did not upgrade to a non-supported Mariadb such as 10.4 in /etc/yum.repos.d/MariaDB.repo.

    0
    Comment actions Permalink
  • Avatar
    Christopher-James Sheppard

    Have to say, after procrastinating about upgrading to MariaDB10.3 from 5.5 using this guide I dont know what i was worrying about. It took less than 90 seconds!! Thanks Robert Asilbekov

     
    0
    Comment actions Permalink
  • Avatar
    Alexander Hammer

    This morning I made an update from MariaDB Version 10.1.41 to 10.1.42 via the Plesk back-end. The update crashes the whole MySQL Server. I'm on Plesk 18.8.11 and CentOS 7.7.

    When doing the update I get the following error message:

    ERROR: Zend_Db_Adapter_Exception: SQLSTATE[HY000] [2002] No such file or directory (Abstract.php:144)<br />
    <br><a href='http://kb.plesk.com/plesk-error/search?metaId=1751d5edcca5340f78144a4499e8c1d5&messageId=2eb8d2699e722503bf79ae1c7819dc4e&file=Abstract.php&line=144&type=Zend_Db_Adapter_Exception&version=17.8.11&message=SQLSTATE%5BHY%5D+%5B%5D+No+such+file+or+directory' target='_blank'>Search for related Knowledge Base articles</a>

    After searching, I found the following article: https://support.plesk.com/hc/en-us/articles/360000331033-Errors-during-Plesk-Update-ERROR-Zend-Db-Adapter-Exception-SQLSTATE-HY000-2002-No-such-file-or-directory- 

    Which I did follow and also the second linked article (this one here). I removed the old installation and installed MariaDB 10.1.42 with not success. When trying to start the mariaDB service the following message appears:

    ● mariadb.service - MariaDB 10.1.42 database server
    Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)
    Drop-In: /etc/systemd/system/mariadb.service.d
    └─migrated-from-my.cnf-settings.conf
    Active: activating (auto-restart) (Result: signal) since Wed 2019-11-06 09:50:05 CET; 3s ago
    Docs: man:mysqld(8)
    https://mariadb.com/kb/en/library/systemd/
    Process: 5979 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=killed, signal=ABRT)
    Process: 5928 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
    Process: 5926 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
    Main PID: 5979 (code=killed, signal=ABRT)

    Nov 06 09:50:05 s20706067 systemd[1]: Failed to start MariaDB 10.1.42 database server.
    Nov 06 09:50:05 s20706067 systemd[1]: Unit mariadb.service entered failed state.
    Nov 06 09:50:05 s20706067 systemd[1]: mariadb.service failed.

    I repeated the step again, with no success. I then did finally a try to install MariaDB 10.2.x. The same.

    Please help me, to solve this problem.

    PS. Could it be, that I installed the MariaDV Version 10.1.x via cli and now - for the first time - I tried to update the sql-server via Plesk back-end?

    Thx Alexander

    0
    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    Hello @Alexander,

    This article is devoted to your issue: https://support.plesk.com/hc/en-us/articles/360010401659-MariaDB-does-not-start-after-update-on-November-the-5th-Assertion-failure-in-file?source=search

    The issue is caused by the last MariaDB update and confirmed as MariaDB bug MDEV-20987

    This issue affects the following versions of the MariaDB SQL Server:

    • 10.1.42
    • 10.2.28
    • 10.3.19
    • 10.4.9 (Not supported)
    0
    Comment actions Permalink
  • Avatar
    Alexander Hammer

    Dear Ivan, thank you soooo much helping. This solved it, even the upgrade to 10.2.27 is now working.

    What do I do in the meantime to prevent MariaDB from being updated to the wrong version?

    thx Alexander

    0
    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    Hello @Alexander,

    As suggested by my colleague at https://support.plesk.com/hc/en-us/articles/360010401659-MariaDB-does-not-start-after-update-on-November-the-5th-Assertion-failure-in-file?source=search:

    To disable auto-updates until MariDB fix the bug, disable their repository, e.g. for CentOS:

    # sed -i 's/enabled=1/enabled=0/g' /etc/yum.repos.d/MariaDB.repo

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

    Hi Alexandr, these packages are in a yum cache, while MariaDB removed them from repositories. Just clean cache with `yum clean all` and it should be all right then.

    0
    Comment actions Permalink
  • Avatar
    Alexander Hammer

    Hi Anton,

    thanks for that! It helped.

    Alexander

    0
    Comment actions Permalink
  • Avatar
    Alexander Hammer

    Fixes are already available. See the Changelog of 10.1.43

    Again, thanks for your quick help.

    Alexander

    0
    Comment actions Permalink
  • Avatar
    Roberto

    Hello,

    After upgrading to MariaDB 10.2  I updated plesk to 18.0.20 and trhen I can´t update components, i have tis error:

    Fatal error during packages installation: [u'ERROR with transaction check vs depsolve:', 'plesk-mysql-server >= 18.0 is needed by pp18.0.20-bootstrapper-18.0-2.centos.7+p18.0.20.2+t191101.1317.x86_64']
    YumRPMCheckError: [u'ERROR with transaction check vs depsolve:', 'plesk-mysql-server >= 18.0 is needed by pp18.0.20-bootstrapper-18.0-2.centos.7+p18.0.20.2+t191101.1317.x86_64']

    I installed plesk-mysql-server from repo PLESK_17_5_3 dist  like here:

    https://support.plesk.com/hc/en-us/articles/360004026073-Unable-to-upgrade-Plesk-with-Percona-mariadb-server-5-0-60-is-needed-by-plesk-mysql-server

    Can you help me?? Thank you in advance. 

    0
    Comment actions Permalink

Please sign in to leave a comment.

Have more questions? Submit a request