Introduction
MySQL/MariaDB can be upgraded from the "MySQL/MariaDB Upgrade" interface in WHM or from the command line using the API. This article provides the steps to upgrade MySQL/MariaDB from the command line.
Procedure
- Access the command line as the 'root' user via SSH or the "Terminal" interface in WHM.
- Run the background_mysql_upgrade_checker_run API call to validate the MySQL/MariaDB state.
[root@server ~]cPs# whmapi1 background_mysql_upgrade_checker_run
---
data:
log_entry: mysql_upgrade_checker_2023-02-24T14:30:53Z
pid: 114733
metadata:
command: background_mysql_upgrade_checker_run
reason: OK
result: 1
version: 1
[root@server ~]cPs# - Review the upgrade checker log at
/var/cpanel/logs/$log_entry/txt
.
Please note that "$log_entry" should be replaced with the log_entry value returned by the background_mysql_upgrade_checker_run API call.
All errors in the log must be addressed before proceeding with the upgrade.
- Run the installable_mysql_versions API call to view the MySQL/MariaDB versions to which the current installation may be upgraded.
[root@server ~]cPs# whmapi1 installable_mysql_versions
---
data:
versions:
-
server: mysql
version: '8.0'
-
server: mariadb
version: '10.5'
-
server: mariadb
version: '10.6'
metadata:
command: installable_mysql_versions
reason: OK
result: 1
version: 1
[root@server ~]cPs# - Run the start_background_mysql_upgrade API call to initiate the upgrade process.
whmapi1 start_background_mysql_upgrade version=$version
Please note that "$version" should be replaced with the applicable version returned from the installable_mysql_versions API call.
To see the upgrade progress and review any errors the upgrade may have encountered, you can review the upgrade log, located at:
/var/cpanel/logs/$upgrade_id/unattended_background_upgrade.log
Please note that $upgrade_id should be replaced with the upgrade_id value returned from the start_background_mysql_upgrade API call.
Additional resources
Validate MySQL status before upgrade
Comments
0 comments
Article is closed for comments.