Prev Next

Create a Project in a MySQL Database

To create a project in a MySQL repository, you work through these stages:

  • Stage 1: Create an empty database repository and set up the data tables
  • Stage 2: Set up the ODBC Driver
  • Stage 3: Set up initial model data


  • A machine with MySQL version 5 or higher installed and running
  • MySQL 32bit ODBC driver, between versions 5.2.4 and 5.3.6 (other versions are not recommended)

1. Create a MySQL Repository

MySQL supports two different storage engines - InnoDB and MyISAM. In older versions of MySQL, MyISAM was the default storage engine, but from MySQL v5.5 onwards InnoDB is the default. As of Enterprise Architect v13, Sparx Systems will no longer provide updates to the MyISAM script and we recommend all users to choose InnoDB, as it supports transactions and UTF8.



See also


Create a new empty database and configure it to your installation's defaults.

Create a MySQL Repository


Open your SQL management console of choice (such as MySQL Workbench) and connect to the new database.


Load the EASchema_1220_MySQL.sql file from the Sparx Systems website.


Run EASchema_1220_MySQL.sql  to create the required database schema.

2. Set up the ODBC DSN



See also


Create a suitable ODBC Data Source (using the MySQL ODBC driver) for the new database.

Make sure you select these extended options:

  • 'Return matched rows instead of affected rows'
  • 'Allow big result sets'
Set up a MySQL ODBC Driver

3. Set up Initial Data

Enterprise Architect repositories require a basic amount of reference data to function correctly.

You can set up this initial data in one of two different ways:

  • Transfer the entire contents of an existing model into the new database, or
  • Load initial data using a SQL Script

3.1 Load Initial Data - Transfer existing model

If you choose to set up your new database with the contents of an existing model then Sparx Systems recommend that a Project Integrity check is performed on the existing model to ensure it is 'clean' and free from data-related errors before being copied into the new database.

The Enterprise Architect installation provides a model called EABase.eap, which is copied into the installation folder specifically for the purpose of providing basic data for a new model. However, if you have customized the various drop-down lists in another model then you might prefer to use that. Regardless of what model you choose to use, the process is the same and is outlined here.



See also


In Enterprise Architect, open the existing repository and select the 'Configure > Model > Integrity > Project Integrity' ribbon option.


In the 'Action' panel, select the 'Report Only' radio button, and in the 'Checks to Run' panel select all checkboxes. Click on the Go button.

Check Project Data Integrity


If Enterprise Architect detects that the existing model contains integrity issues, they will be listed in the main panel at the bottom of the dialog. These issues should be resolved before continuing with the project transfer.


With Enterprise Architect open ensure that there is no project loaded, by clicking on the Project list button and selecting 'Close Project'.


Select the 'Configure > Model > Transfer > Project Transfer' ribbon option.

The 'Project Transfer' dialog displays.


In the 'Transfer Type' panel, select 'File to DBMS'.


In the 'Source Project' field, click on the Browse. button and browse for the name of the project file to copy to the repository.

If the .EAP file has Replication enabled, this must be removed before performing the transfer.

Remove Replication


At the right of the 'Target Project' field, click on the Browse. button.

The 'Datalink Properties' dialog displays.


Select 'Microsoft OLE DB Provider for ODBC Drivers' from the list.

Click on the Next button.


In the 'Use Data source name' field, click on the drop-down arrow and select the ODBC Data Source you configured to point to your new database.

Click on the OK button. The 'Project Transfer' dialog redisplays.

Set up a MySQL ODBC Driver


If required, select the 'Logfile' checkbox and type a path and filename for the data transfer log file.


Click on the Transfer button to begin the data transfer process.


When the process is complete, you have created a project on a MySQL database and can now connect to it and open it from Enterprise Architect.

Connect to a MySQL Repository

3.2 Load Initial Data - SQL Script



See also


Open your SQL management console of choice (such as MySQL Workbench), and connect to the new database.


Load the EABase_1220_MySQL.sql file from the Sparx Systems website.


Run EABase_1220_MySQL.sql  to create the required database schema.

Learn more