MySQL Databases interface to show MySQL as offline, Updating MariaDB to v10.2.35 or v10.3.26

WebhostUk

Upgrading MariaDB to v10.2.35 or v10.3.26 causes the cPanel UI to not read the grants properly, which leads to cause select sites to be inaccessible and the MySQL Database page within the cPanel interface returns the following error.

More important to note that MariaDB should still be running, the cPanel error log should populate the string the UI is having issues reading:

[2020-11-05 07:37:27 +0000] warn [cpmysql] Error (Invalid grant string: SET DEFAULT ROLE 0 FOR '$user'@'$host'
) while parsing grant: SET DEFAULT ROLE 0 FOR '$user'@'$host' at /usr/local/cpanel/Cpanel/Mysql.pm line 956, <STDIN> line 1.
        Cpanel::Mysql::__ANON__(__CPANEL_HIDDEN__...) called at /usr/local/cpanel/3rdparty/perl/530/lib/perl5/cpanel_lib/Try/Tiny.pm line 118

cPanel has opened an internal case for their development team to investigate this further.

For reference, the case number is CPANEL-34745.

Follow this article to receive an email notification when a solution is published in the product. 

Before proceeding with these changes, we encourage you to backup your database in the event a restore is required.

To backup the MySQL database directory, the following command can be executed as root:

mysqldump mysql > /backup/mysql.sql

Once backup is complete, you can proceed with altering that database column order.

The following command performs the appropriate alterations for the database:

mysql -e "ALTER TABLE mysql.user MODIFY IF EXISTS password_last_changed timestamp DEFAULT CURRENT_TIMESTAMP NULL AFTER max_statement_time, MODIFY IF EXISTS password_lifetime smallint unsigned DEFAULT NULL AFTER password_last_changed, MODIFY IF EXISTS account_locked enum('N', 'Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL after password_lifetime;"

Apply the change by restarting the MariaDB service:

/scripts/restartsrv_mysql

They should go into effect immediately. 

yum versionlock clear

Then run upcp to have the MariaDB packages updated:

/scripts/upcp