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 a database and tables
  • Stage 2: Set up a connection to the database
  • Stage 3: Load initial data

Prerequisites

  • A machine with MySQL server version 5 or higher installed and running

1. Create a MySQL Database and tables

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.

Note:  MySQL has a setting (max_allowed_packet) that sets a limit on the amount of data that can be returned by the database server. To avoid issues in the future this value needs to be larger that the largest record in your repository.  How large will the largest record be? We can't advise on that - it depends on how you use Enterprise Architect. Typically the largest element items are embedded documents and images, or baselines of large Packages.  It is not unusual for customers to require a max_allowed_packet of 128M or, in some environments, even larger than that.

Step

Action

See also

1.1

Create a new empty database and configure it to your preferences, making sure to configure the correct character set and collation.  The exact method you use to create the database is not important to this discussion, therefore use the most convenient or familiar method.

For example the MySQL SQL command to create a new database called 'ea1558' is:

      >   create schema `ea1558`;

Native Connection to MySQL repository

1.2

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

1.3

Download EASchema_1558_MySQL.sql from the Sparx Systems website and open it in your SQL management console of choice.

1.4

Run EASchema_1558_MySQL.sql  to create the required database tables.

2. Set up Connection to MySQL repository

From Enterprise Architect version 16 there is now two different ways that Enterprise Architect can connect to MySQL repositories:

Note: Sparx Systems recommend Native connections as they are much simpler and don't require any other software installed or configured.

3. Set up Initial Data

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

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

  • Transfer the entire contents of an existing model into the new database, or
  • Run initial data 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.qea, 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.

Step

Action

See also

3.1.1

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

3.1.2

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 Data Integrity

3.1.3

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.

3.1.4

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

3.1.5

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

The 'Project Transfer' dialog displays.

3.1.6

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

3.1.7

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 file has Replication enabled, this must be removed before performing the transfer.

Remove Replication

3.1.8

At the right of the 'Target Project' field, click on the button and select either:

Open Server Connections - Native Connection

3.1.9

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

3.1.10

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

3.1.11

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.

3.2 Load Initial Data - SQL Script

The Sparx Systems website provides a SQL Script that contains a series of INSERT statements that will load an empty database with all the data needed by Enterprise Architect.

Step

Action

See also

3.2.1

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

3.2.2

Download the EABase_1558_MySQL.sql file from the Sparx Systems website and open it in your SQL management console.

3.2.3

Run EABase_1558_MySQL.sql  to load the required initial data.

Learn more