Wiki Spaces

Documentation
Projects
Resources

Get Help from Others

Q&A: Ask OpenMRS
Discussion: OpenMRS Talk
Real-Time: IRC Chat | Slack

Documentation

Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: code block formatting

...

  1. Install the MySQL server package as root:

    Code Block
    languagebash
    sudo apt-get install mysql-server
  2. Enter a root password

...

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:

Code Block
languagebash
$ sudo docker run --name openmrs-mysql56 -p 3306:3306 -e MYSQL_ROOT_PASSWORD=openmrs -d mysql:5.6

...

You may also ask Docker to list all Docker containers:

Code Block
languagebash
$ 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:

Code Block
languagebash
sudo docker run --name openmrs-mysql55 -p 3316:3306 -e MYSQL_ROOT_PASSWORD=openmrs -d mysql:5.5

Stopping your database container is easy:

Code Block
languagebash
sudo docker stop openmrs-mysql56

If you decide you don't need the database any more you can remove it:

Code Block
languagebash
sudo docker rm openmrs-mysql56