Recently a cloud server of mine experienced a MySQL / MariaDB server failure due to a an "OOM - Out of Memory" situation caused by an error log overrun. The source of the error was the MariaDB database of a Nextcloud instance - specifically the error ""Incorrect definition of table".

Prior to the error appearing I had performed a major upgrade of a Nextcloud instance and the MySQL / MariaDB server which had, unbeknownst to me, resulted in some incompatibilities in its database. Nextcloud still functioned without any noticeable problems, but was producing many database error messages every minute. Eventually the MySQL / MariaDB server daemon failed and was unable to restart, and its log file had grown to be exceptionally large.

The solution was to run a simple command:

mysql_upgrade --user=<admin-user> -p

the MariaDB equivalent command is:

mariadb-upgrade --user=<admin-user> -p

This immediately repaired the database, allowing the database server to be restarted.

Best practice is to run the "mysql_upgrade" or "mariadb-upgrade" command after a database server upgrade, and to closely monitor the MySQL / MariaDB error log - using "mysql_upgrade" to do initial troubleshooting.

More information about "mysql_upgrade" can be found here:

https://dev.mysql.com/doc/refman/8.0/en/mysql-upgrade.html

https://mariadb.com/kb/en/mariadb-upgrade/