MySQL InnoDB Schema – Is it Safe to Delete on a New Amazon RDS Instance?

amazon-rdsinnodbMySQL

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 |
+--------------------+

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.

Best Answer

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';

you might see something like this

/rdsdbdata/db/innodb

It will point to this folder as the base of InnoDB.

If you run

SHOW GLOBAL VARIABLES LIKE 'innodb_log_group_home_dir';

you might see something like this

/rdsdbdata/log/innodb

This is where ib_logfile0 and ib_logfile1 live.

If you run

use innodb
show tables;

you will see nothing because there are no .frm files in it.

Even though the innodb database contains no storage engine data files (.frm or .ibd), you cannot drop the innodb database because the folder /rdsdbdata/db/innodb is not empty.