MySQL

JDBC Driver

The MySQL JDBC driver is one of the ones included with the dcm4chee distributions. Feel free to update it if you need/want to.

Create the dcm4chee database

Create and initialize the dcm4chee database.

The file create.mysql can be found at <installation folder>/dcm4chee-<x.xx.x>-mysql/sql/create.mysql, where <x.xx.x> is the dcm4chee version number.

MySql 5.5+

The file create.mysql contains SQL instructions that populate the database with empty tables.

Currently, create.mysql contains instructions suitable for older versions of MySql.

Until this bug is fixed, create.mysql must be edited before it can be used with MySql 5.5+.

All instances of type= must be replaced with engine=

> mysql -uroot -p<root password>
mysql> create database pacsdb;
mysql> grant all on pacsdb.* to 'pacs'@'localhost' identified by 'pacs';
mysql> \q
> mysql -upacs -ppacs pacsdb < create.mysql

Create the ARR database

Now create the audit record repository (ARR) database.

> mysql -uroot -p<root password>
mysql> create database arrdb;
mysql> grant all on arrdb.* to 'arr'@'localhost' identified by 'arr';
mysql> \q

The tables will be created automatically when the audit record repository first starts up.

If desired, <deployment folder>\dcm4chee-arr-3.0.11-mysql\sql\dcm4chee-arr-mysql.ddl can be used to manually create them now.

 > mysql -uarr -parr arrdb < dcm4chee-arr-mysql.ddl

Adjust DB configuration if necessary

The database configuration information is contained within dcm4chee-<x.xx.x>-mysql/server/default/deploy/pacs-mysql-ds.xml and arr-mysql-ds.xml.

If you're using a different database name, user name, etc., you'll need to update this file.

You should also optimize the database configuration in my.cnf or my.ini. See Getting Started with MySQL, Using Option Files, and this post