Deploying Connector/MXJ with a pre-configured database
To include a pre-configured/populated database within your Connector/MXJ JAR file you must create a custom data_dir.jar
file, as included within the main connector-mxj.jar
(Connector/MXJ 5.0.3 or earlier) or mysql-connector-mxj-gpl-[ver]-db-files.jar
(Connector/MXJ 5.0.4 or later) file:
- First extract the
connector-mxj.jar
ormysql-connector-gpl-[ver]-db-files.jar
file, as outlined in the previous section (see , "Creating your own Connector/MXJ Package"). - First, create your database and populate the database with the information you require in an existing instance of MariaDB - including Connector/MXJ instances. Data file formats are compatible across platforms.
- Shutdown the instance of MySQL.
- Create a JAR file of the data directory and databases that you intend to include your Connector/MXJ package. Include the
MariaDB
database, which includes user authentication information, in addition to the specific databases to include. For example, to create a JAR of theMariaDB
andmxjtest
databases:shell> jar -cf ../data_dir.jar mysql mxjtest
- For Connector/MXJ 5.0.3 or earlier, copy the
data_dir.jar
file into the extractedconnector-mxj.jar
directory, and then create an archive forconnector-mxj.jar
.For Connector/MXJ 5.0.4 or later, copy the
data_dir.jar
file into the extractedmysql-connector-mxj-gpl-[ver]-db-files.jar
directory, and then create an archive formysql-connector-mxj-db-gpl-[ver]--files.jar
.
Note that if you are create databases using the InnoDB engine, you must include the ibdata.*
and ib_logfile*
files within the data_dir.jar
archive.