Skip to content

Creating a MySQL database for MCT

VWoeltjen edited this page Feb 18, 2015 · 6 revisions

Prerequisites

Get Your MCT Packaging

IF you are given an MCT packaging file: extract it to ~/PATH_TO_MCT_DIRECTORY/mct/platform-assembly/target

ELSE your packaging is created when you build from source:

1) After running a successful Maven build, navigate to the target directory in platform-assembly:

cd ~/PATH_TO_MCT_DIRECTORY/mct/platform-assembly/target

2) The packaging should be in a file named mct-platform-VERSION-dist.tar.gz (e.g. mct-platform-1.8b3-dist.tar.gz). Extract it:

tar -xzf mct-platform-VERSION-dist.tar.gz

3) The packing should now be extracted to a directory named mct-platform-VERSION-dist. This is your packaging directory.

Configure local properties

Open local.properties file in your packaging directory and adjust the following settings:

mct.admin_userName=(name of an existing user with administration privileges in your database)
mct.admin_password=(password of the above user)
mct.database_userName=(name of a new user to create for accessing MCT's database; for instance, "mctdbuser")
mct.database_password=(password for this user)
mct.database_name=(name you would like to give the new database; for example, "mct")
mct.database_host=(host for your MySQL instance; likely "localhost" if running locally)
mct.database_port=(port for your MySQL instance; generally 3306)
mct.runtime.memory=512
mct.db.check-schema-version=false

Run Ant database preparation scripts

After configuring your local.properties file, use ant to run the create-database-user goal. This will perform the initial database setup (creating a user and empty database). From your packaging directory:

  • Mac / Linux: ant -f bin/createDatabase.xml create-database-user
  • Windows: ant -f bin\\createDatabase.xml create-database-user

You should see a message from Ant indicating "BUILD SUCCESSFUL". If not, double-check to ensure that your MySQL instance is running, and that your local.properties has been configured accurately.

After the initial creation, the database can be populated with initial tables using the create-database goal. Note that this drops any existing tables, so can be used to clean out an existing database installation. (Warning: This means that any existing MCT data in the database will be lost!)

  • Mac / Linux: ant -f bin/createDatabase.xml create-database
  • Windows: ant -f bin\\createDatabase.xml create-database

This process may take slightly longer (a couple of minutes.) Again, Ant should report back "BUILD SUCCESSFUL" when complete. If not, ensure that the previous create-database-user goal was successful, and double-check your local.properties configuration.

Configure and run MCT

Now, you should have a database ready to run MCT. First, you will need to configure MCT's properties to ensure it knows the correct database to connect to. As of Release 8, MCT is configured by default to use a local instance of a Derby database; to utilize the new MySQL database:

  • First, copy the contents of resources/properties/mysql.properties to resources/properties/persistence.properties, replacing the the default configuration there (which is written and tuned for a local Derby database.)
  • Edit resources/properties/persistence.properties to ensure the following values match up with the database you've just created:
    mct.database_connectionUrl=(URL for your MySQL instance; for instance, jdbc\:mysql\://localhost\:3306/)
    mct.database_name=(name of database you've just created; for instance, "mct")
    mct.database_userName=(name of the user you've created for accessing the MCT database; for instance "mctdbuser")
    mct.database_password=(password you've specified for the above user)

You should now be able to launch MCT using your MySQL database by running MCT.jar (located in the top-level directory of your MCT installation.) Under most operating systems, you can do this simply by double-clicking the file from a file browser; alternately, you can run from command line using java -jar MCT.jar.

Other installations of MCT can utilize the same MySQL database by modifying resources/properties/persistence.properties as described above, so long as that database is accessible to the machines on which MCT is installed. It is not necessary to set up a separate database for every individual client; indeed, using the same database among multiple installations is what permits sharing of created compositions between users.

Something went wrong with that request. Please try again.