Table of Contents
- Download the latest
- MySQL installer using this link
- Run the
- install program (
- Choose Custom Setup
- Change the installation directory to C:\MySQL5 and the data directory to c:\MySQL5\data\. We recommend installing into a directory without spaces, e.g., c:\MySQL5* or *c:\MySQL5\data. The default directory usually includes spaces, which seems to cause problems with MySQL.
- Select "Detailed Configuration"
- Select "Developer Machine"
- Select "Multifunctional Database"
- InnoDB Tablespace Settings, Use the default (c: and Installation Path).
- Select "DSS/OLAP"
- Enable TCP/IP Networking (Port 3306), check "Add firewall exception..." and leave "Enable Strict Mode" checked.
- Default Character Set, select "Best support for Multilingualism" (utf8)
- Check "Installed as Windows Service" and leave "Launch the MySQL Server automatically" checked.
- Root password (password) (Note: Do NOT forget this root password for MySQL! You will need it later.)
- Execute the configuration. The installer should step through the process and give you green check marks at each stage
- Open Windows Firewall (Start ? Settings ? Control Panel ? Windows Firewall)
- Under the "Exceptions" tab, click the "Add Port" button
- Name: MySQL
- Port number: 3306
- Optional: For added security, click the "Change scope" button and limit to "My network (subnet) only". This will prevent computers outside of your local area network from being able to access your database directly.
Other Operating Systems
- 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 the credentials for the user with root privileges. Do Not Forget the Password
- Click next and finish the installation.
Note: MySQL might fail to run as a service, for this you can manually start it by navigating to Start > Settings > Control Panel > Administrative Tools > Services
Then find the service called “MySQL”, right click > Properties then you can either click the “start” button or set “Startup Type” to automatic.
Debian/Debian derived distributions
Install the MySQL server package as root:
Code Block language bash
sudo apt-get install mysql-server
- Enter a root password
Docker allows easy installation of MySQL in a self-contained container on linux but is a bit more complicated option on Windows or OSX. See https://docs.docker.com/engine/installation/ on how to start using Docker.
After you have installed Docker, it's easy to launch a MySQL container. This will download a MySQL 5.6 Docker image and run it:
$ sudo docker run --name openmrs-mysql56 -p 3306:3306 -e MYSQL_ROOT_PASSWORD=openmrs -d mysql:5.6
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.
You may also ask Docker to list all Docker containers:
$ sudo docker ps --all CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 233f1d85e7c9 mysql:5.6 "/entrypoint.sh mysql" 20 seconds ago Up 19 seconds 0.0.0.0:3306->3306/tcp openmrs-mysql56
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 container, you might say:
$ sudo docker run --name openmrs-mysql55 -p 3316:3306 -e MYSQL_ROOT_PASSWORD=openmrs -d mysql:5.5
Stopping and starting your database container is easy:
# stopping... $ sudo docker stop openmrs-mysql56 # ...and starting again $ sudo docker start openmrs-mysql56
If you decide you don't need the database any more you can remove it:
$ sudo docker rm openmrs-mysql56
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.