Question - How to fix MySQL connection issue?

After docker compose, it is not possible to connect to MySQL, in addition, DefectDojo also broke, after some time it got the same error.
Eramba error:

Tried:

docker kill $(docker ps -q)
docker rm $(docker ps -a -q)
docker rmi $(docker images -q)
docker system prune -a -f --volumes

and again docker compose -f docker-compose.simple-install.yml up -d, tried .env file and generally do not change everything else, but there is no result.

mysql   | 2023-06-16T14:07:23.273741Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock

mysql   | 2023-06-16T14:07:23.274319Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.28'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server - GPL.

docker ps:

mysql:8.0.28-oracle   "docker-entrypoint.s…"   7 minutes ago  Up 7 minutes 3306/tcp, 33060/tcp mysql                    

docker exec mysql:

mysql> SHOW DATABASES;
+--------------------+
| Database           |
+--------------------+
| eramba             |
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
5 rows in set (0.00 sec)

Help please!
Thanks in advance!

Hello,

Not sure it will help you but I am sharing my experience. I had the same problem as you: eramba not connecting to mysql while both containers were running. For my case, I had an old MySQL deployed locally and running, so I believe there was a conflict on the MySQL ports. I disabled my local MySQL and the magic occurred.
Please note that nothing showed up (about ports) in the container mysql logs.

Renaud

Hello,

Check this one: Docker Install | Eramba learning portal

Hi,
Thanks,
I don’t have MySQL locally, but I’ll double check it

Hi,
Thanks,
But I have already seen this and tried to add 755 permissions on folder mysql in the docker folder.
Didn’t help :frowning:

Please write to support@eramba.org and we will do a quick call to check what the issue might be.

Thanks everyone, but the problem was solved by reinstalling a clean OS.
I agree with @rlebrun, the problem looks like “already used port”. So, if someone faced this problem, then check all processes/services, sometimes you don’t know what someone installed on the server and/or, perhaps, removed something incorrectly.

1 Like