I replaced mySQL 5.7 with MariaDB 10.0 on my Ubuntu 16.04 server. I backed up the databases before installation using mysqldump. During the MariaDB install it said a "flag file" present meant the DBs weren't binary compatible, so I restored the backup post-install. MariaDB doesn't like my privilege tables, so I tried to run mysql_upgrade. This is a log of the output (with full verbosity and system tables only):
root@server:~# mysql_upgrade --force -s -vvv
Looking for 'mysql' as: mysql
Looking for 'mysqlcheck' as: mysqlcheck
The --upgrade-system-tables option was used, user tables won't be touched.
Phase 1/6: Checking and upgrading mysql database
Running 'mysqlcheck with default connection arguments
# Connecting to localhost...
# Disconnecting from localhost...
Processing databases
mysql
CHECK TABLE `column_stats` FOR UPGRADE
mysql.column_stats OK
CHECK TABLE `columns_priv` FOR UPGRADE
mysql.columns_priv OK
CHECK TABLE `db` FOR UPGRADE
mysql.db OK
CHECK TABLE `engine_cost` FOR UPGRADE
mysql.engine_cost OK
CHECK TABLE `event` FOR UPGRADE
mysql.event OK
CHECK TABLE `event_old` FOR UPGRADE
mysql.event_old OK
CHECK TABLE `func` FOR UPGRADE
mysql.func OK
CHECK TABLE `gtid_executed` FOR UPGRADE
mysql.gtid_executed OK
CHECK TABLE `gtid_slave_pos` FOR UPGRADE
mysql.gtid_slave_pos OK
CHECK TABLE `help_category` FOR UPGRADE
mysql.help_category OK
CHECK TABLE `help_keyword` FOR UPGRADE
mysql.help_keyword OK
CHECK TABLE `help_relation` FOR UPGRADE
mysql.help_relation OK
CHECK TABLE `help_topic` FOR UPGRADE
mysql.help_topic OK
CHECK TABLE `host` FOR UPGRADE
mysql.host OK
CHECK TABLE `index_stats` FOR UPGRADE
mysql.index_stats OK
CHECK TABLE `innodb_index_stats` FOR UPGRADE
mysql.innodb_index_stats OK
CHECK TABLE `innodb_table_stats` FOR UPGRADE
mysql.innodb_table_stats OK
CHECK TABLE `ndb_binlog_index` FOR UPGRADE
mysql.ndb_binlog_index OK
CHECK TABLE `plugin` FOR UPGRADE
mysql.plugin OK
CHECK TABLE `proc` FOR UPGRADE
mysql.proc OK
CHECK TABLE `procs_priv` FOR UPGRADE
mysql.procs_priv OK
CHECK TABLE `proxies_priv` FOR UPGRADE
mysql.proxies_priv OK
CHECK TABLE `roles_mapping` FOR UPGRADE
mysql.roles_mapping OK
CHECK TABLE `server_cost` FOR UPGRADE
mysql.server_cost OK
CHECK TABLE `servers` FOR UPGRADE
mysql.servers OK
CHECK TABLE `slave_master_info` FOR UPGRADE
mysql.slave_master_info OK
CHECK TABLE `slave_relay_log_info` FOR UPGRADE
mysql.slave_relay_log_info OK
CHECK TABLE `slave_worker_info` FOR UPGRADE
mysql.slave_worker_info OK
CHECK TABLE `table_stats` FOR UPGRADE
mysql.table_stats OK
CHECK TABLE `tables_priv` FOR UPGRADE
mysql.tables_priv OK
CHECK TABLE `time_zone` FOR UPGRADE
mysql.time_zone OK
CHECK TABLE `time_zone_leap_second` FOR UPGRADE
mysql.time_zone_leap_second OK
CHECK TABLE `time_zone_name` FOR UPGRADE
mysql.time_zone_name OK
CHECK TABLE `time_zone_transition` FOR UPGRADE
mysql.time_zone_transition OK
CHECK TABLE `time_zone_transition_type` FOR UPGRADE
mysql.time_zone_transition_type OK
CHECK TABLE `user` FOR UPGRADE
mysql.user OK
Phase 2/6: Fixing views... Skipped
Phase 3/6: Running 'mysql_fix_privilege_tables'
ERROR 1408 (HY000) at line 539: Event Scheduler: An error occurred when initializing system tables. Disabling the Event Scheduler.
FATAL ERROR: Upgrade failed
How do I resolve the event scheduler issue so that the process can complete? I had to –skip-grant-tables to get to this point so I'm understandably keen to fix this so I can run the server with proper privileges.
Best Answer
I was unable to resolve this.
I did get to where I wanted to be, though: I started the server with
--skip-grant-tables
, backed up each database I wanted to keep, then removed the data folder and ranmysql_install_db
to create a fresh copy of the system tables. I set permissions up again, and then re-imported the databases. All OK now.