Installation: Loading the Database

Loading the Database for the First Time

It is highly recommended that a special database user is created to run Unity.  It is best if this user has restriction to only the required databases, and that grant privs are not given even for these.

An SQL script has been provided in database/tools to create the user and the databases.  You are urged to modify the script to use a username and password of your own choosing.

There are three databases required to run the Unity system.  To begin loading the database, it is necessary to create the following databases:

  • Authentication Database - unity_auth
  • Runtime Database - unity_runtime
  • World Database - unity_world

The database names may be changed, if you choose to do so.  For the sake of clarity, the default names will be used in this document.

To load the databases, all of the SQL files for each table must be loaded to the MySQL server.  In order to clearly indicate changes, the development team has determined that each table will be stored in a separate file, and that each row within the table will be stored as a separarte INSERT.  Since this results in a great many files, we have created a couple of scripts to simplify the loading process.

Once the database user has been created, and the privs reloaded, you can begin the loading process.  If you wish to use the loading scripts, you may proceed as follows:

  1. Open a terminal session or cmd.exe.
  2. Change to the directory containing the SQL files for the database you wish to load.
  3. You must use the full path of the loading script (ex: C:\UnityCore\database\tools\loaddb).
  4. Enter the database username, password, and database name that are appropriate for your server and the target database.

For a Windows platform, this command will be similar to

C:\UnityCore\database\tools\loaddb unity password unity_auth

Or for Linux it would be similar to

/opt/unity/src/unity/database/tools/loaddb unity password unity_auth

for the authentication database.

Repeat the process for the other two databases.

Updates

If you have already loaded your database, and do not wish to reload for a new release, you may load the SQL files found in the database/updates directory.  The updates are separated according to the database that they should be applied to.  You may, of course, use whatever SQL tool you prefer.  The loaddb script provided will apply these, if you wish to use it.  The instructions above will work for updates, as well, provided you have changed to the appropriate directory.

Published on  October 26th, 2011