Tag: mysql

Importing a MySQL database with a Python script fails when the same command works on the command line, what gives?

I’m running a MySQL server in docker container and am trying to import a .sql file in a Python script (Flask app). This is my code: os.system(“docker exec -i %s_db_1 mysql -u<username> -p<password> <db name> < %s” % (name, db_file)) It returns this error in the terminal the Flask app is running in: ERROR 1064 […]

cannot open connection of database in docker

sql docker: FROM ubuntu:latest RUN apt-get update RUN apt-get upgrade -y RUN apt-get -y install mysql-client mysql-server curl RUN sed -i -e”s/^bind-address\s*=\s* =” /etc/mysql/my.cnf ADD database.sql /var/db/database.sql ENV user admin ENV password admin ENV url file:/var/db/database.sql ENV right WRITE ADD ./start-database.sh /usr/local/bin/start-database.sh RUN chmod +x /usr/local/bin/start-database.sh EXPOSE 3306 CMD [“/usr/local/bin/start-database.sh”] ——–\—— startdatabase.sh #!/bin/bash # […]

So many Binlog_dump connections in Processlist?

We are using Meteor and MySQL stack (numtel) and trying to connect to 3 databases simultaneously. One database is sitting with the application as localhost (mysql version 5.5.44). Other on is on another EC2 machine as native server (mysql version 5.5.44). And third one is in Docker container (mysql version 5.6.26). Our meteor application stops […]

Docker (NGINX, PHP, mySQL) and Windows – File Permissions

I’ve been looking into docker for a few hours; I’m running Windows 8.1 as the host machine, and VirtualBox with boot2docker. This is my docker-compose.yml: mysql: image: mysql ports: – “6603:3306” environment: MYSQL_ROOT_PASSWORD: mysql MYSQL_USER: mysql fpm: image: php:7.0.2-fpm volumes: – /c/Users/Administrator/www:/var/www/html ports: – “9000:9000” links: – mysql nginx: image: nginx ports: – “80:80” – […]

Why is docker failing to mount a volume and start on CentOS 7?

I have a CentOS 7 minimal install with networking enabled and a few extra simple tools installed (e.g. htop). Docker was installed as per these instructions. The command that I am running is this: docker run –name mysql5.6 -v /tmp/mysql:/etc/mysql/conf.d -e MYSQL_ROOT_PASSWORD=blah -p 22 -p 3306 -d mysql:5.6 But the container will not start. If […]

Cannot connect to MySQL within running docker container

we have a scenario where we launch a MySQL docker container, try to connect to the MySQL within the container, and do something, after that we stop and remove the container. We do this for hundreds of times, say 200 and more in our code. Occasionally, we failed to connect to the MySQL within docker […]

How to make a docker image with a populated database for automated tests?

I want to create containers w/ a MySQL db and a dump loaded for integration tests. Each test should connect to a fresh container, with the DB in the same state. It should be able to read and write, but all changes should be lost when the test ends and the container is destroyed. I’m […]

how can i create a database on mysql docker service

I’m trying to run moodle phpunit on my gitlab ci server. Using gitlab-ci.yml file i’m creating a container with php 5.6 and mysql service. # Services services: – mysql:latest before_script: – mysql -e ‘CREATE DATABASE gitlab_ci_test DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_bin;’ ; I’m getting ERROR 2002 (HY000): Can’t connect to local MySQL server […]

mysqldump does not dump everything when running in script

I have a mysql server running in a docker container named dockersql. To backup it, I use docker run -ti –rm –link dockersql:mysql -v $HOME/backups/20160202/:/hostbackup mysql /bin/bash -c “mysqldump -u user -p -h mysql database > /hostbackup/mysqldump.sql” This works fine. I have include this same line inside a shell backup script which does other stuff. […]

nginx as proxy to my mysql server in docker

I’m working with a server in the cloud with N dockers containers, in the server I have one nginx that redirect based on the domain to my docker containers, I can perfectly redirect my http traffic, but I’m getting troubles with when it is mysql since it uses a protocol different to http, I tried […]

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