User Tutorial - Setting up a Data Source Server

Updated for version mgui-1.0.20-alpha

This tutorial guides you through the process of setting up a data source server (either PostgreSQL or MySQL) for use with ModelGUI.


ModelGUI provides data source connectivity based upon Java's JDBC interface. This allows a large flexibility for users, since the application can link to data sources via "connectors" for a large variety of popular database server software. While this is true in principle, in practice there are always subtle (or not-so-subtle) differences between servers which necessity some customization in ModelGUI. The two currently supported open-source database servers are PostgreSQL and MySQL, which will be described below.

Install Server Software

Note: these instructions are for personal installations of the servers. If you want a more advanced installation (e.g., providing access to an entire group over a network), consult your system administrator about setting this up. If you are a sys admin, or want more control over your installation, consult the appropriate site (PostgreSQL or MySQL).

In all cases: Be sure to record the user name and password you set for the root user.


For PostgreSQL, the root user is, by default "postgres". You can specify a different name if desired.


Go to this page and download the appropriate installer for your platform. This will provide a graphic interface to guide you through the setup.


The installation depends on how you want to do things. The least painful method is to use the graphical installer, which can be downloaded at this page. Make the downloaded file executable and run it, with the commands:

chmod +x
sudo ./

This will install the software and set up the user account.

To install in alternative ways, such as apt-get or yum, follow the appropriate instructions on this page.


For MySQL, the root user is called "root".


Download and run the appropriate installer at this page.


For non-Ubuntu Linux, you can find the appropriate installers at this page.

For Ubuntu, you can follow instructions at this page.

Setting up ModelGUI

Defining Drivers

ModelGUI provides an interface for defining data source drivers, which connect you to the server you just installed. In the Datasource Panel, expand "Admin" and click "Define drivers..". The following dialog box will appear:


Selecting the server you want to define, enter the root user name and password, which you hopefully recorded above. Click "Update".

To save these changes, so they apply every time you run ModelGUI, click "Save to file". Navigate to your ModelGUI installation folder, then "data_sources", and select the appropriate file, which will be evident from the file name. Click OK and we're done.

Testing the Driver

To test whether the driver was set up correctly, we can try to create a new data source. Under Sources, select "<-NEW SOURCE->", and click "Define". This will bring up the following dialog box:


We want a new data source, so check the "New" box, enter the root user name and password, and give the new data source a name. Then click OK. From the Datasource Panel, click "Create" and the "Connect". If you get a success message, the driver is working!


Going further

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License