Table of Contents
It is recommended that your version of MySQL is compatible with the version of the OpenMRS Platform you are installing.
- MySQL 5.6 supports OpenMRS Platform version 2.2 and below
- MySQL 5.7 supports OpenMRS Platform version 2.3 and above
This requires installing an older version than the latest MySQL release.
- The MySQL installer for Windows is found here
- Click "Looking for previous GA versions?" to install version 5.6 or 5.7
- For other versions, click "Archives"
- Run the installer program (.msi)
- Accept the license agreement
- When given the option to update installer please do so
- Under Feature Selection select Full Installation Setup and select the right Architecture for your computer (32-bit / 64-bit)
- Click next and you will be shown a list of applications that you need in order to meet the requirements for installing all services. Make sure you satisfy all the requirements, if not, please install the missing applications on your machine.
- On the next configuration options select “Developer Machine”
- Leave all other settings to default
- Enter a username and password. Note: These will be are the credentials for the user with root privileges. Do Not Forget the Password Do not forget this password.
- Click next and finish the installation.
Debian/Debian derived distributions
To install an older version such as MySQL 5.6 or 5.7 (recommended), follow the instructions laid out here.
To install the latest package, perform the following.
Install the MySQL server package as root:
Code Block language bash
sudo apt-get install mysql-server
- Enter a root password
After you have installed Docker, it's easy to launch a MySQL container. This will download a MySQL 5.6 7 Docker image and run it:
$ sudo docker run --name openmrs-mysql56mysql57 -p 3306:3306 -e MYSQL_ROOT_PASSWORD=openmrs -d mysql:5.67
Now you can connect to the database on port 3306 with username "root" and password "openmrs". Note that the port mapping argument
-p 3306:3306 is needed to expose MySQL service's port inside the container to the host.
$ sudo docker ps --all CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 233f1d85e7c9 mysql:5.67 "/entrypoint.sh mysql" 20 seconds ago Up 19 seconds 0.0.0.0:3306->3306/tcp openmrs-mysql56mysql57
Need to test on another MySQL version? You may run multiple MySQL container's simultaneously just as long as you give them unique names and port mappings. For example to run a MySQL 5.5 7 container, you might say:
$ sudo docker run --name openmrs-mysql55mysql57 -p 3316:3306 -e MYSQL_ROOT_PASSWORD=openmrs -d mysql:5.57
Stopping and starting your database container is easy:
# stopping... $ sudo docker stop openmrs-mysql56mysql57 # ...and starting again $ sudo docker start openmrs-mysql56mysql57
If you decide you don't need the database any more you can remove it:
$ sudo docker rm openmrs-mysql56mysql57
Note: Some people may have trouble with different MySQL versions. Although higher versions of MySQL should work fine with OpenMRS, if you encounter problems with later versions of MySQL, try downgrading to version 5.6 as that is the recommended version.