How to convert MAIN mysql database to InnoDB from MyIsam

点点圈 提交于 2019-12-24 23:53:57

问题


I am trying to manage mysql group replication and I noticed a problem when manipulating users and grants. 10 of the main mysql tables in the main mysql database are MyIsam. So I cant add databases or user permissions because they fail and wont replicate. Master-master group replication requirs everything InnoDB.

ALTER TABLE works fine on regular custom databases/tables but how do you fix this on the main mysql database?

I tried this but they all fail:

ALTER TABLE mysql.db ENGINE = InnoDB;
ALTER TABLE mysql.tables_priv ENGINE = InnoDB;
ALTER TABLE mysql.user ENGINE = InnoDB;

ERROR: ERROR 1726 (HY000): Storage engine 'InnoDB' does not support system tables.

Another error running CREATE USER...

[ERROR] Plugin group_replication reported: 'Table db does not use the InnoDB storage engine. This is not compatible with Group Replication'

ERROR 3098 (HY000): The table does not comply with the requirements by an external plugin group_replication.

Server version: 5.7.23-log MySQL Community Server


回答1:


DO NOT CHANGE THE ENGINE FOR SYSTEM TABLES

MySQL has not yet changed the code enough to allow for mysql.* to be anything other than MyISAM. MySQL 8.0 makes the change by turning the tables (the "data dictionary") into a InnoDB tables, with radically different structure and capabilities.

Since you are at 5.7.23, you are only one (big) step away from 8.0.xx. Consider upgrading.

Replication works with MyISAM tables, but clustering replication does not -- Galera and Group Replication deal with those MyISAM tables in other ways. See the documentation on what happens with GRANT, CREATE USER, etc. Do not use UPDATE and INSERT to manipulate the login-related tables.

(The Author of this Question seems to have fixed the problem by uninstalling a plugin.)



来源:https://stackoverflow.com/questions/52615806/how-to-convert-main-mysql-database-to-innodb-from-myisam

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!