I am trying to connect to a RDS instance inside a docker container. I have tried to telnet in the host and everything is working correcting. When trying to do the same inside the docker container it returns this error:
(2003, 'Can\'t connect to MySQL server on \'xxx.xxx.us-east-1.rds.amazonaws.com\' (110 "Operation timed out")')
The docker container has as base image alpine:3.7 and I have installed MariaDB packages (mariadb-dev, mariadb, mariadb-client).
I have debugged and I have narrowed down to a connection between container and external remote servers.
Dockerfile:
FROM alpine:3.7
RUN apk add --no-cache mariadb mariadb-dev mariadb-client python3
RUN pip3 install <django-packages>
...
ENTRYPOINT ["./entrypoint.sh"] # Run app and supervisord processes
CMD ["sh"]
Related
enter image description here
Error while connecting to the database
Facing the guacamole connectivity issue with the mysql database. Tried to install mysql inside guacamole container and the connection was established successfully, where as, when we trigger the same container from application, db connectivity is giving an issue.
Below is the docker file that has been used. Any leads will be super helpful
FROM guacamole/guacamole:1.3.0 as guacamole
FROM **(customCentos)centos7_linux:latest
RUN yum update -y &&
yum install -y java-1.8.0-openjdk
COPY --from=guacamole /usr/local/tomcat /usr/local/tomcat
COPY --from=guacamole /opt/guacamole /opt/guacamole
COPY logback.xml /opt/guacamole
COPY java.security /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.292.b10-1.el7_9.x86_64/jre/lib/security/java.security
WORKDIR /opt/guacamole
ENV PATH /usr/local/tomcat/bin:$PATH
CMD ["/bin/bash", "/opt/guacamole/bin/start.sh"]
I have a a clean Windows Server 2019 VM. I installed docker on it. Then I'm trying to install mysql. I run docker pull mysql it is successfully pulled. When I try to run docker run --name=MySqlServer -d mysql
I receive the following error:
docker : docker: Error response from daemon: failed to start service utility VM (createreadwrite): kernel 'C:\Program Files\Linux Containers\kernel' not found.
I am new to containers and I don't know how to troubleshoot this issue. I have already set experimental:true to daemon.json
Issue type:
initialization bug with mysql:8 docker official image.
Versions:
Docker version 20.10.14, build a224086;
Linux Ubuntu 21.10 host machine OS;
Docker mysql:8 and mysql:oracle official image tags, both with same bug.
Steps to reproduce:
run mysql:8 docker official image from docker hub passing the needed args at the CLI env variables. Such as:
sudo docker run --name app-mysql-container -v [some-absolute-path-in-your-host-machine]:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=[some-root-password] -e MYSQL_DATABASE=[some-database-name] -e MYSQL_USER=[some-user-name] -e MYSQL_PASSWORD=[some-user-password] -d mysql:8
use another instance of the terminal to follow the logs live of the container just created:
sudo docker --follow logs app-mysql-container
then use at the other instance of the terminal:
sudo docker exec -it app-mysql-container bash , in order to get inside the container bash shell, and type:
mysql -u root -p
[type password]
ERROR HAPPENS CONTINUOUSLY until server finishes getting up - about 8 minutes !!
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)
after the 8 minutes, when the mysqld server finally gets ready for connection, with a ready socket connection at 3306 port, then everything starts working fine... both for access from inside the container (MySQL CLI) as from outside linked containers with applications connecting to the mysql server.
Eventually the MySQL server starts almost instantly, rather than after 8 minutes... something is wrong with this docker image...
Printscreens below:
I'm trying to run flyway from docker following the official repository. When running the folowing cmd:
docker run flyway/flyway -url=jdbc:mysql://localhost:3306/flyway_demo_db -user=* -password=* info
I installed flyway cmd-tool on my machine and ran a similar cmd:
flyway -url=jdbc:mysql://localhost:3306/flyway_demo_db -user=* -password=* info
This works fine. I'm unsure what's causing this since -password is a valid argument. My machine is running on Ubuntu 20.04
I was missing an cmd argument for the docker run command --net="host"
Example that works:
docker run --net="host" flyway/flyway -url=jdbc:mysql://localhost:3306/flyway_demo_db -user=* -password=* info
Source: How to access host port from docker container
I'm trying connect to mysql-server docker container from my host with mysqlshell(mysqlsh) client and native mysql installer yum on fedora but in mysqlsh and in native mysql installer client i have same error message:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)
But when i connect to docker container mysql-server with bash i can to connect to mysql with no problem and execute SQL's commands etc
i ran the following docker command
sudo docker run --name=mysql-teste -p 3606:3606 -d mysql/mysql-server
My O.S: Fedora 30
Docker version 1.13.1, build 1185cfd/1.13.1
I don't have mysql-server installed on my host i only want connect from my host to mysql-server docker container.
Someone has a same problem?
Make sure you have mysql server installed and running, then it should work ok
see:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)