By default Mirth comes bundled with Apache Derby as its database for storing channel and message data. While this is useful for getting started quickly and evaluating Mirth, we strongly recommend switching to PostgreSQL or another external database in a production setting.
For various reasons, it is sometimes useful to connect to the embedded database to perform cleanup if the tables are too large or to export data. Below are instructions for how to connect to Mirth’s embedded Derby database.
Step 1: Download SQuirreL SQL and start it up.
Step 2: Under the Drivers panel, edit the “Apache Derby Embedded” driver and under “Extra Class Path” add derby.jar (located in the %MIRTH_HOME%/lib/ folder).
Step 3: Under the Aliases panel, create a new alias using the “Apache Derby Embedded” driver and set the URL to “jdbc:derby:C:\Program Files\Mirth\mirthdb;create=true” without the quotes, and replacing that path with the path to your mirthdb folder. The user name and password are blank.
Step 4: Stop Mirth Service! If you do not, you will not see all the tables. (See list of table names below.)
You should now be able to connect to the database. Make sure that the Mirth server is stopped before trying to access the database.
(note: for me the driver path is “jdbc:derby:C:\Program Files\Mirth Connect\appdata\mirthdb;create=true” and not “%MIRTH_HOME%/lib“).
Here is the Mirth Forum post for how to clear out messages: http://www.mirthproject.org/community/forums/showthread.php?t=2354
Mirth Database Table Names for version 3.4.2.
The installation I have of SQuirreL is 20170305_2022. The best part is that SQuirreL has Database Schema Diagrams! It’s a plugin named “Graph” that is built in. See screenshot below: