Tag: mysql

Using a docker container querying an AWS RDS Instance

I am developing an application that is going to be deployed using a docker container. This app connect and queries a Aurora database on AWS RDS. I would like to make some QA tests, pointing to test database instead of Aurora db production. What is the best approach? Create a database replica on the same […]

Using docker for unit test

I run a MySQL container with –net=host option. So now i can make unit test using:g: self.db = MySQLdb.connect(host=”″, user=”XYZ”, passwd=”XYZ”, db=”TEST_DB”) The problem is when I try to dockerize my unit test, linking the container with my MySQL container, the IP is not valid. I need to use the real ip for the […]

How do I extend a default docker image command without interrupting the default behaviour

I’m using the following docker-compose settings: db: image: mysql:5.5 ports: – “3306:3306” environment: MYSQL_ROOT_PASSWORD: mysql MYSQL_USER: userx MYSQL_PASSWORD: password MYSQL_DATABASE: mydb and I need to be able to update the permissions of the user with the command: GRANT ALL PRIVILEGES ON *.* TO ‘userx’ with grant option; But I don’t want to change the default […]

Bootstraping Percona Xtradb Cluster in Docker gives the error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist

My goal is to get a Percona XtraDB Installation running in a Docker Container. For this i wrote up the following configuration. Dockerfile: FROM ubuntu:wily ENV DEBIAN_FRONTEND noninteractive # # ENVIRONMENT INSTALL # RUN apt-get update && apt-get upgrade -y && apt-get dist-upgrade -y && apt-get install -y wget curl netcat python-dev python-setuptools python-software-properties vim […]

Docker mysql container cannot use a data volume defined on startup

I have encountered an issue while trying to run a mysql container with a data volume mounted on a host. Here is a dockerfile: from ubuntu:14.04 maintainer Tiago Pires, tandrepires@gmail.com # Because docker replaces /sbin/init: https://github.com/dotcloud/docker/issues/1024 RUN dpkg-divert –local –rename –add /sbin/initctl RUN echo “deb http://archive.ubuntu.com/ubuntu trusty main universe” > /etc/apt/sources.list RUN apt-get update && […]

docker cp permissions are wrong when you mount the directory back into container

I am trying to grab the /var/lib/mysql directory out of a running mysql container in order to keep it for persistence. Yet when I then mount the directory as a volume mysql complains that it does not have permission: mysqld: Table ‘mysql.plugin’ doesn’t exist 2016-02-29 13:34:19 1 [ERROR] Can’t open the mysql.plugin table. Please run […]

Links between service Rancher Server 1.0.0

I’m porting my docker environment to rancher server 1.0.0. I have a wordpress container which is linked to a mysql container. Each one are in separate stack: One stack for the wordpress container and one for the mysql container. Previously, linking between those two container was achieve using a docker-compose.yml for my wordpress container containing: […]

Connect to MySQL Server inside Docker container in an Microsoft Azure VM

I created an Ubuntu 15.10 VM on Microsoft Azure. On the Server i created a docker container with MySQL running (IP: CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 4255233555db mysql “/entrypoint.sh mysql” 16 hours ago Up 16 hours>3306/tcp compose_mysql_1 I can connect over ssh to the VM and then access the MySQL-Server […]

redirect the output of docker-exec

docker exec is not working for me. If I connect to a running container with docker exec -it mymachine bash and run sh -c ‘mysql -u root < /tmp/schema.sql’, it works. If I just run docker exec mymachine sh -c ‘mysql -u root < /tmp/schema.sql’, it doesn’t give any errors, but it doesn’t do anything. […]

Docker: Granting access to linked mysql container

So I have a mysql-client container and a mysql-database container, just for testing purposes. I have linked the 2 containers using docker run –link. Now I want to create a user in the database and grant it select, create, update, etc. access, so that it can connect to the database and perform queries, etc. So, […]

Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.