Tag: mysql

Docker “Can't connect to local MySQL server through socket”

I’m new to Docker. I managed to build an image with the things I wanted (CentOS with Apache, PHP, MySQL, MailHog and supervisord.) It works fine. Now, what I’m trying to do is turn my image (one container) into multiple images/containers: one for web, one for db, etc. I managed to build those different images, […]

Start mysql automatically when running a Docker container

I have created a Dockerfile to have a development environment on my computer with php7, mysql and some other library. The apache service starts automatically when a run the container but I can’t get the same results with mysql. The last sentence of my Dockerfile looks like this CMD [“bash”, “run.sh”] and then in run.sh […]

docker best way to run mysql

I’m new in docker, and i have two microservices running in two containers and i would like to create simple database for them. i created it like that: docker run –net=kajsnetwork -d -e MYSQL_ROOT_PASSWORD=’mypassword’ -v /storage/mysql1/mysql-datadir:/var/lib/mysql mysql i enter the container using docker exec -it containernumber /bin/bash and then i created database… But when i […]

Docker container connect to MySQL database locally -> redirect to another container

I am new to Docker. I have read that it is better to keep an app per container. I need to run web app (LAMP stack). So I have found the container for running PHP + Apache. Now I need to set up a mysql container. But I am not sure what is the correct […]

Containerized server application failing to connect to MySQL databases

I’m trying to connect my server code running as a Docker container in our Kubernetes cluster (hosted on Google Container Engine) to a Google Cloud SQL managed MySQL 5.7 instance. The issue I’m running into is that every connection is being rejected by the database server with Access denied for user ‘USER’@’IP’ (using password: YES). […]

MySQL in docker-compose — access denied

I try to start MySQL server with docker-compose. Here is docker-compose.yaml part: mysql: restart: always image: mysql:latest ports: – “3306:3306” volumes: – /Users/user/Documents/.docker/mysql/config:/etc/mysql/ – /Users/user/Documents/.docker/mysql/data:/var/lib/mysql environment: – MYSQL_ROOT_PASSWORD=’123′ – MYSQL_ROOT_HOST=’172.18.0.1′ You see I’ve specified root password and host as it is said here. Then I try to connect to db (using Intellij Idea if that […]

Kubernetes MySQL replication – Master service host inquiry

I currently have a working MySQL master and slave with asynchronous replication set up on a Kubernetes cluster. I’m trying to plan for a contingency if the master goes down, the slave will pick up the slack and what not. I figured the first step would be to review the Dockerfiles and scripts that define […]

Connecting to percona docker from a java docker container

I know there have been many similar questions, but none of them are what I want. I’m following this because I specifically need 5.5, at least for now. My java project (which accesses mysql) is in a container I built with docker build -t projectname-testing . The Dockerfile is pretty standard, it just copies over […]

Install mysqlclient-python in Docker

I am trying install mysqlclient-python in docker with Debian 8 but when I run python3 setup.py install I get error: x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.4/_mysql.o -lmysqlclient -lpthread -lz -lm -ldl -lssl -lcrypto -o build/lib.linux-x86_64-3.4/_mysql.cpython-34m.so /usr/bin/ld: cannot find -lssl /usr/bin/ld: cannot find -lcrypto collect2: error: ld returned 1 […]

Dockerize MySQL with database and tables

I want to create a MySQL container with an initial database and its tables, from a Dockerfile. I also have a specific /etc/mysql/mysql.conf.d/mysqld.cnf file (I can simply use ADD directive in Dockerfile.) I want my Dockerfile to create a MySQL image with a database named, for example, DBNAME and with the following tables: CREATE TABLE […]

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