MySQL 8.0.27 upgrade failure

If after the upgrade the mysql doesn't start don't panic! In mysql8 mysql_upgrade command is dummy, and the database upgrades automatic on first restart. In my scenario I was upgrading from 8.0.26  to mysql8.0.27 and I see errors like bellow and the database won't start:

2021-11-25T13:44:12.805159Z 4 [System] [MY-013381] [Server] Server upgrade from '80026' to '80027' started.
2021-11-25T13:44:13.792252Z 4 [ERROR] [MY-013178] [Server] Execution of server-side SQL statement '-- Create slow_log CREATE TABLE IF NOT EXISTS slow_log (start_time TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), user_host MEDIUMTEXT NOT NULL, query_time TIME(6) NOTNULL, lock_time TIME(6) NOT NULL, rows_sent INTEGER NOT NULL, rows_examined INTEGER NOT NULL, db VARCHAR(512) NOT NULL, last_insert_id INTEGER NOT NULL, insert_id INTEGER NOT NULL, server_id INTEGER UNSIGNED NOT NULL, sql_text MEDIUMBLOB NOT NULL, thread_id BIGINT UNSIGNED NOT NULL) engine=CSV CHARACTER SET utf8 comment="Slow log"; ' failed with error code = 13, error message = 'Can't get stat of './mysql/slow_log.CSV' (OS errno 2 - No such file ordirectory)'.
2021-11-25T13:44:13.821868Z 0 [ERROR] [MY-013380] [Server] Failed to upgrade server.
2021-11-25T13:44:13.822120Z 0 [ERROR] [MY-010119] [Server] Aborting

The solution is really simple:

sudo -u mysql -s
touch ./mysql/general_log.CSV
chown mysql:mysql  ./mysql/general_log.CSV
touch ./mysql/slow_log.CSV
chown mysql:mysql  ./mysql/slow_log.CSV
Share with Me via Nextcloud