← Back to team overview

maria-discuss team mailing list archive

Re: ERROR 1071 with mysql_upgrade

 


> Den 17. jul. 2019 kl. 11.48 skrev Erik Cederstrand <erik@xxxxxxxxxxxxxx>:
> 
> Thanks, Jocelyn!
> 
>> Den 17. jul. 2019 kl. 11.28 skrev jocelyn fournier <jocelyn.fournier@xxxxxxxxx>:
>> It seems this table should be in InnoDB format, not MyISAM (same for innodb_table_stats).
> 
> I tried altering the engine to InnoDB but was not allowed. Hmm.
> 
> Then I decided to just drop the table to have mysql_upgrade create it again. Now mysql_upgrade complains that the tablespace for that table exists and I need to drop it. But:
> 
> MariaDB [mysql]> ALTER TABLE innodb_index_stats DROP TABLESPACE;
> ERROR 1146 (42S02): Table 'mysql.innodb_index_stats' doesn't exist
> [mysql]> DROP TABLE innodb_index_stats;
> ERROR 1051 (42S02): Unknown table 'mysql.innodb_index_stats'
> MariaDB [mysql]> CREATE TABLE `innodb_index_stats` (
>    ->   `database_name` varchar(64) COLLATE utf8_bin NOT NULL,
>    ->   `table_name` varchar(199) COLLATE utf8_bin NOT NULL,
>    ->   `index_name` varchar(64) COLLATE utf8_bin NOT NULL,
>    ->   `last_update` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
>    ->   `stat_name` varchar(64) COLLATE utf8_bin NOT NULL,
>    ->   `stat_value` bigint(20) unsigned NOT NULL,
>    ->   `sample_size` bigint(20) unsigned DEFAULT NULL,
>    ->   `stat_description` varchar(1024) COLLATE utf8_bin NOT NULL,
>    ->   PRIMARY KEY (`database_name`,`table_name`,`index_name`,`stat_name`)
>    -> ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0;
> ERROR 1050 (42S01): Table '`mysql`.`innodb_index_stats`' already exists
> 
> 
> I tried stopping the server, deleting all files in /var/db/mysql/mysql/innodb_index_stats.* and restarting, but I still see the same behaviour above.

Answering my own question: I ended up solving my problem with the following:

* stop the server
* copy in /var/db/mysql/mysql/innodb_* files from a different 10.4 server where these tables were already InnoDB
* start the server
* drop the tables
* re-run mysql_upgrade

Thanks for the hints, everyone!

Kind regards,
Erik

References