Is it safe to delete the innodb schema on a new Amazon RDS instance?

Joe*_*and 5 mysql innodb amazon-rds

As per the title, I'm struggling to find out if it's safe to delete the innodb schema that's created on a fresh Amazon RDS instance.

mysql> SHOW DATABASES;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| innodb             | -- This was automatically created when the instance was created
| mysql              |
| performance_schema |
+--------------------+
Run Code Online (Sandbox Code Playgroud)

I know it's not doing any harm being sat there - there's no tables/content or anything, I'm just curious as to why it's there and I've not been able to find out why from any other sources.

Rol*_*DBA 5

There is a reason you cannot touch the innodb database.

This is where Amazon stores the system tablespace file ibdata1

If you run

SHOW GLOBAL VARIABLES LIKE 'innodb_data_home_dir';
Run Code Online (Sandbox Code Playgroud)

you might see something like this

/rdsdbdata/db/innodb
Run Code Online (Sandbox Code Playgroud)

它将指向该文件夹作为 InnoDB 的基础。

如果你跑

SHOW GLOBAL VARIABLES LIKE 'innodb_log_group_home_dir';
Run Code Online (Sandbox Code Playgroud)

你可能会看到这样的东西

/rdsdbdata/log/innodb
Run Code Online (Sandbox Code Playgroud)

这就是ib_logfile0居住的地方ib_logfile1

如果你跑

use innodb
show tables;
Run Code Online (Sandbox Code Playgroud)

.frm您将看不到任何内容,因为其中没有文件。

即使 innodb 数据库不包含存储引擎数据文件(.frm.ibd),您也无法删除该innodb数据库,因为该文件夹/rdsdbdata/db/innodb不为空。