简体   繁体   English

在使用 ENGINE=MyISAM 的 AWS RDS 中创建 mysql 表时,它会使用 InnoDB 覆盖它

[英]When creating a mysql table in AWS RDS with ENGINE=MyISAM, it overrides it with InnoDB

I am using '5.7.mysql_aurora.2.10.2' version of AWS Aurora MySQL instance and I have trying to create Log table with innoDB engine so I can Log things (INSERT query) combined with SIGNAL command.我正在使用 AWS Aurora MySQL 实例的“5.7.mysql_aurora.2.10.2”版本,我试图用 innoDB 引擎创建日志表,这样我就可以结合 SIGNAL 命令记录事物(INSERT 查询)。 Something like this:像这样的东西:

INSERT INTO Log(type, info, date) VALUES("ERROR", "Error happened...!", CURRENT_TIMESTAMP());
SIGNAL CUSTOM_EXCEPTION SET MESSAGE_TEXT = "Error happened...";

But as I found out, SIGNAL basically rolls back everything including my INSERT statement.但正如我发现的那样,SIGNAL 基本上回滚了所有内容,包括我的 INSERT 语句。 I have been trying to figure out the workaround and I stumbled upon the DB tables with engine MyISAM which should solve my problem.我一直在试图找出解决方法,我偶然发现了带有引擎 MyISAM 的数据库表,它应该可以解决我的问题。 So I decided to create a table for testing:所以我决定创建一个表进行测试:

CREATE TABLE t (i INT) ENGINE = MYISAM;

And for some reason, the engine keeps being InnoDB.出于某种原因,引擎一直是 InnoDB。 I have tested on my local instance and it works fine but as soon as I try it on my RDS database, it keeps changing back.我已经在我的本地实例上进行了测试,它工作正常,但是一旦我在我的 RDS 数据库上尝试它,它就会不断变回来。 I have tried to use ALTER TABLE but it doesn't work.我曾尝试使用 ALTER TABLE 但它不起作用。

Is there a possibility that RDS has some configuration that doesn't let me use any other engine other than InnoDB? RDS 是否有一些配置不允许我使用除 InnoDB 之外的任何其他引擎?

Amazon Aurora only supports InnoDB. Amazon Aurora 仅支持 InnoDB。

https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraMySQL.Reference.html says: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraMySQL.Reference.html说:

Aurora MySQL clusters use the InnoDB storage engine for all of your data. Aurora MySQL 集群使用 InnoDB 存储引擎存储您的所有数据。

This is by design.这是设计使然。 They implemented their distributed storage by modifying the InnoDB storage engine.他们通过修改 InnoDB 存储引擎来实现他们的分布式存储。 Aurora simply doesn't work with any other storage engine, so they disabled the capability to specify the storage engine for a table. Aurora 根本无法与任何其他存储引擎一起使用,因此他们禁用了为表指定存储引擎的功能。

Aurora is not MySQL.极光不是 MySQL。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM