Download and Installation Instructions for MySQL Community Edition (CE)

and Loading the openmrs.mwb file and the demo-1.12.0.sql

This document provides instructions for downloading MySQL Workbench for a Windows 64 bit install, following by the creation of a database schema and actual database that contains 5000 patient records.

Download/Install MySQL:The main link for MySQLWorkbench for Windows is at: the suggestion that the MySQL Installer option at be chosen.

There are two options on the above page for the Installer. The first, allows you to choose the desired tools of MySQL to install, and select just Server and Workbench. Note that the 32 bit installer in both cases for the figure above contains all of the required steps to install either a 32 or 64 bit Windows version.Download and start the installer and it will take you through a series of steps –the first of which is to select the “Custom” option that allows you select MySQL Server 64 bit and MySQL Workbench 64 bit versions for download and install. Just follow the instructions from that point on, which includes not only the two different tools, but also configuring a development server for MySQL that will run on your PC/laptop. Note that you want to restart after the install has successfully completed.

Utilizing MySQL Workbench:This section provides the instructions to use MySQL Workbench to open and create a database schema and tuples for a 5000 sized patient database from the OpenMRS electronic medical record. To download the patient data set, at: select the demo-1.12.0.zip. After download, unzip to create demo-1.12.0.sql which is an SEQUEL (sql) data file format that contains both the database schema definition as well as the actually instances; note the is a 100 megabyte file. There is a second data set that is larger that can also be downloaded large-demo-data-1.9.7sql.zip that generates large-demo-data-1.9.7.sql.

Once you have downloaded and extracted to demo-1.12.0.sql, open MySQL Workbench as below:

Select File, Open SQL Script, and browse to the directory to select demo-1.12.0.sql and from the window below, select, the Open option

The end result will be the screen:

In addition, you can open a model –using File/Open Model using openmrs.mwb from the webpage to get:

From this model, you can click on the EER1 diagram icon to yield:

Lastly, if you have installed MySQL successfully, you can then actual import the database that is in demo-1.12.0.sql into an actual database using Workbench. Below is a list of steps to accomplish this:

  1. Open MySQL Workbench
  2. On the MySQL Connections (top-left), click the + button to add a new connection.
  3. Give the connection a name, e.g. Localhost
  4. Click OK after the IP address and credentials are properly set (the default configuration is 127.0.0.1, username = root and no password).
  5. Click on the newly created MySQL connection.
  6. Go to File -> Run SQL Script
  7. Select the demo-1.12.0.sql file from wherever it is stored in your computer.
  8. In the default schema name, you can select a previously created schema or write a new name so that it is created on the fly. E.g. type openmrs if you want the script to be executed in a new database called openmrs.
  9. Default character set can be left blank.– this is a big file so may take a few minutes
  10. Click Run on right window.

1

Download and Installation Instructions for MySQL Community Edition (CE)

and Loading the openmrs.mwb file and the demo-1.12.0.sql

1

Download and Installation Instructions for MySQL Community Edition (CE)

and Loading the openmrs.mwb file and the demo-1.12.0.sql

  1. On the new window, click OK to connect to the database.
  2. Let the SQL script run until it finishes (this may take some time).
  3. Your openmrs database is now fully imported into the schema you selected/wrote.

The screen below also shows SQL queries that have been written in the Query1 window. You can write queries and select one and then use the lightning bolt icon to run the query. The result of the SELECT * FROM OpenMRS.Person; query is shown in the Result Grid window of the first table; the result of SELECT * FROM OPENMRS.person_name; is shown in the second window.

1