Skip to content

Setting up MariaDB 5.5.x in Docker

craigmcchesney edited this page Jun 30, 2020 · 1 revision

Setting up MariaDB 5.5.x in Docker

Currently the CDB is know to run well with 5.5.x as it is the same version that is installed with Redhat linux distribution. If you are using a debian based linux system you may want to deploy the correct version of mysql using docker instead of forcing install of this older package. Below you will find the instructions for setting this up:

sudo apt-get install mysql-client-5.7 docker docker.io
sudo groupadd docker
sudo usermod -aG docker $USER
# You may need to reboot after this... Logging out and in didn't work for me.

# make sure docker is running
sudo service docker status

# Create mariadb container
docker run -p 3306:3306 --name mariadb -e MYSQL_ROOT_PASSWORD=cdb -d mariadb:5.5.64-trusty 

# Next time you just need to run this command  `docker container start mariadb` to start up the same database.

You also need to edit a create db file to include an additional host.

diff --git a/sbin/cdb_create_db.sh b/sbin/cdb_create_db.sh
index 3172f972..600ca067 100755
--- a/sbin/cdb_create_db.sh
+++ b/sbin/cdb_create_db.sh
@@ -19,7 +19,7 @@ CDB_DB_PASSWORD=cdb
 CDB_DB_HOST=127.0.0.1
 CDB_DB_PORT=3306
 CDB_DB_ADMIN_USER=root
-CDB_DB_ADMIN_HOSTS="127.0.0.1 bluegill1.aps.anl.gov gaeaimac.aps.anl.gov visa%.aps.anl.gov"
+CDB_DB_ADMIN_HOSTS="% 127.0.0.1 bluegill1.aps.anl.gov gaeaimac.aps.anl.gov visa%.aps.anl.gov"

I added the % symbol under the CDB_DB_ADMIN_HOSTS in the sbin/create_db.sh file. It may be a part of the distribution in the future but currently its a step to get this working.

Clone this wiki locally