Mysql – How to access different MySQL databases in a same instance in Amazon RDS

amazon-rdsMySQLschema

In my Amazon RDS Dashboard, the configuration details of my DB instance (running MySQL) mentions that my DB name is ebdb, which is the default one, I haven't changed it. It's the same screen as here, instead that I don't want to change the instance name.

I've managed to connect to this DB using MySQL Workbench and I've imported a schema carpool which now lies alongside the existing ebdb one:

MySQL Workbench Navigator

In the config of my app I've specified this DB url: jdbc:mysql://${DB_HOST}:3306/carpool, DB_HOST being the endpoint specified in the RDS Dashboard.

If my app tries to access the DB it throws an error because it can't find the table. I assume that's because it looks in the wrong database.

In the RDS Dashboard, placing the cursor on the label DB Name gives some info, including An Amazon DB instance can host multiple databases. Then why is the name of the database hard-coded ebdb ?

How can I access another database in my RDS instance ?

Best Answer

Well, I was living in a lie.

The simple reason why I couldn't access my table on RDS was because RDS runs on Linux and MySQL table names are case-sensitive on Linux, while my local DB runs on Windows where MySQL table names are not case-sensitive.

About multiple databases in a single RDS instance: RDS does accept multiple databases. It's just that, for an unknown reason, only the initial database of the instance is always displayed in the dashboard. This still doesn't make sense to me because this database has nothing more than other ones, apart being the first one.