【问题标题】:ERROR 3098 (HY000): The table does not comply with the requirements by an external pluginERROR 3098 (HY000): 该表不符合外部插件的要求
【发布时间】:2019-04-15 13:26:03
【问题描述】:

设置:

  • master master 中的三个 mysql group 复制节点。
  • 一切正常。我可以添加用户/数据库并插入/更新数据。
  • 每个节点都绑定一个私有 IP 地址。
  • 我创建了一个 bash 脚本来连接 mysql 以删除用户。
  • 使用脚本删除数据库可以正常工作。

问题:

以下命令将不会运行。我可以创建用户和数据库并删除数据库,但不能删除用户。我不知道它是复制问题还是特权问题。

  • DELETE FROM mysql.user WHERE user='testme123';
  • 从 mysql.db WHERE user='testme123' 中删除;
  • 如果存在“testme123”则删除用户;

ERROR 3098 (HY000) at line 1: 该表不符合外部插件的要求。

LOG: [ERROR] Plugin group_replication 报告:'表用户不使用 InnoDB 存储引擎。这与组复制不兼容。

我通过本地 mysql 控制台也以 root 身份登录时遇到同样的错误。

问题:

  • 什么可以阻止这种情况?
  • 如何解决我缺少的问题?

【问题讨论】:

  • 什么版本的 MySQL?
  • Mysql 5.7(不是 mariadb)

标签: mysql bash replication mysql-group-replication


【解决方案1】:

如果您使用 Group Replication(在 5.7 或 8.0 中),则必须通过 GRANT/DROP/CREATE USER/etc 命令进行所有用户身份验证,而不是 INSERT/UPDATE/DELETE/etc。

由于严重的技术困难,MyISAM 没有在 Group Replication 中复制。

(上述cmets也适用于Galera / PXC。)

(警告:我所说的可能并不完全正确,但我认为它会让你远离麻烦,并解决手头的问题。)

【讨论】:

    【解决方案2】:

    就我而言,我在从单主模式 MySQL 复制组恢复备份时遇到了同样的错误。我在mysqldump cmd 期间使用--single-transaction 标志进行了备份。

    $ mysqldump -uroot -p<root_password> -h<host> --set-gtid-purged=OFF --single-transaction --all-databases --triggers --routines --events < dump.sql
    

    这里,查看--single-transaction标志的用法,了解它导致的问题。

    $ mysqldump --help
    ...
    --single-transaction 
                          Creates a consistent snapshot by dumping all tables in a
                          single transaction. Works ONLY for tables stored in
                          storage engines which support multiversioning (currently
                          only InnoDB does); the dump is NOT guaranteed to be
                          consistent for other storage engines. While a
                          --single-transaction dump is in process, to ensure a
                          valid dump file (correct table contents and binary log
                          position), no other connection should use the following
                          statements: ALTER TABLE, DROP TABLE, RENAME TABLE,
                          TRUNCATE TABLE, as consistent snapshot is not isolated
                          from them. Option automatically turns off --lock-tables.
    ...
    

    因此,在阅读了@RickJames 提供的建议后,我只需在备份期间从mysqldump cmd 中删除--single-transaction 标志,然后将其恢复到新的复制组。

    注意: MySQL 服务器版本为 5.7.25

    【讨论】:

      猜你喜欢
      • 2020-09-15
      • 2021-08-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-06-06
      • 2021-09-24
      • 1970-01-01
      • 2018-05-15
      相关资源
      最近更新 更多