Skip to main content

How safe is the WHM upgrade for MariaDB and MySQL

Comments

3 comments

  • User Avatar
    cPRex Jurassic Moderator

    Hey there!  The update itself is incredibly safe as that process is completely automated by WHM.  The real issue is "will my stuff work" after the upgrade is complete, as there's no going back.

    Only a database admin reviewing each site individually would be able to know for sure, which is a major quest, and there's really no good way to answer that.

    What if you upgraded one server to a newer system and migrated accounts to that as a test?  They wouldn't even necessarily need to be live on that server, but you could access the migrated site manually with a hosts file to see if things are behaving as you expect.

    0
  • User Avatar
    AndyB

    Of course I meant if things should still work after the update. The problem is that there are hundreads of site on each server x 5 servers so migrating one site or 50 sites as a test will not say much about the entire process.

    What I was looking for was feedback from people that performed such updates (Maria 10.5 and 10.6 to 10.11 and MySQL 8.0 to 8.4) on relatively high density shared servers and if there were a lot of problems afterwards or only minor ones.

    0
  • User Avatar
    mtindor

    I can't speak about the MariaDB upgrade (I'm still on 10.6 with Tuxcare ELS support)

    Check your existing /etc/my.cnf files for:

     

    1. . default-authentication-plugin=

    This was deprecated in 8.0.x and totally removed in 8.4.   If you have default-authentication-plugin= in your /etc/my.cnf, after it upgrades to 8.4 it won't start and will generate an error until you comment that out.

    2.  mysql_native_password = ON

    mysql_native_password was deprecated in 8.0.34 and replaced with caching_sha2_password.  You probably already have this set in your 8.0 /etc/my.cnf, which is good.  You'll want to make sure it is in /etc/my.cnf after upgrade to 8.4.

    If mysql_native_password = ON is NOT in your /etc/my.cnf after upgrade to 8.4, then if you have any mysql users whose passwords were created using mysql_native_passwor, then those websites and other things connecting to MySQL are going to fail authentication until you add this back to /etc/my.cnf and restart MySQL.

    You can determine if you need the mysql_native_password = ON line in /etc/my.cnf after upgrading to MySQL 8.4 or newer by doing this (this is the long way) as root via CLI.

    # mysql mysql

    mysql> select user,plugin from user where plugin = 'mysql_native_password';

    mysql>  quit

    If you see one or more users using the mysql_native_password plugin, then you will want to make sure that mysql_native_password = ON is in your /etc/my.cnf after you've upgraded to MySQL 8.4.

    If you do NOT have any users using mysql_native_Password plugin, do NOT enable it.   You're in good shape.

    For those of us who have had hosting accounts since cPanel was first released, way back when using some pretty ancient versions of MySQL, and then migrated those hosting accounts to new servers multiple times in the past two decades, you'll have tons of users whose password was set using mysql_native_password.   Making sure mysql_native_password = ON will allow those accounts to continue to authenticate.

    I think that ultimately when you upgrade to MySQL 9.x, the option to use mysql_native_password will be gone.   So if you do have MySQL users using the mysql_native_password plugin, you'll have to update each of those passwords manually using MySQL statements that not only change the password but change the plugin for that user from mysql_native_password to caching_sha2_password.   You will actually have to know the existing password and update the password using caching_sha2_password with MySQL ALTER statements.  It's one big *#(^)$ and a royal pain in the ass.

    So make sure you never update to MySQL 9.x if you have any users still using the mysql_native_password plugin

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

    Also, make use of the current sql_mode set

    mysql> show variables like 'sql_mode';
    +---------------+-------------------------------------------+
    | Variable_name | Value                                     |
    +---------------+-------------------------------------------+
    | sql_mode      | ONLY_FULL_GROUP_BY,NO_ENGINE_SUBSTITUTION |
    +---------------+-------------------------------------------+
    1 row in set (0.00 sec)

    If you upgrade to 8.4, the upgrade may change the sql_mode to something else and may cause you some issues.  If you know beforehand what your MySQL server mode is set to, you can then add/update your sql_mode= entry in /etc/my.cnf after upgrade to 8.4 such as:

    sql_mode=ONLY_FULL_GROUP_BY,NO_ENGINE_SUBSTITUTION

    NOTE:  your sql_mode may be different / likely will be different.  The point is to look and see what it's set to on a current 8.0.x server and make sure it's set the same after the upgrade to 8.4 on that server and you'll be fine as far as this goes.

    If you have heavily modified a default /etc/my.cnf (because you were trying to tune MySQL performance), there may have been some lines you added in your /etc/my.cnf to increase this or decrease that.  There is a possibility that a couple of those things might not long be proper on an 8.4 server.   I can't think of any off the top of my head, but there probably are a few and I'm just forgetting.

    With all i've said above, it may sound daunting, but my upgrades went fine knowing all of this ahead of time.   I manually made backups of all of my existing mysql tables before any upgrades just in case something gets butchered, but I've never had that happen with an 8.0 to 8.4 upgrade.

    Good luck

     

     

    0

Please sign in to leave a comment.