I’m running a MySQL container using Docker on a server (an old PC under my bed). I’ve successfully created a MySQL user and database inside the container, and the container is up and running.
Server Details:
IP Address: 192.168.1.27
Container Name: sqldatabase
MySQL Version: 5.7
Container Port: 3306
I’ve ensured the user has the necessary privileges and that MySQL is configured to accept connections from any IP address (bind-address = 0.0.0.0). Also, the server is reachable from my laptop via ping.
However, when I try to connect to the MySQL container using MySQL Workbench from my laptop, the connection fails.
Here are the steps I’ve taken so far:
- Verified that the MySQL container is running and accessible.
- Checked network connectivity between my laptop and the server.
- Ensured port 3306 is open and accessible from my laptop.
- MySQL Workbench Connection Settings:
Connection Name: MySQL Connection
Connection Method: Standard (TCP/IP)
Hostname: 192.168.1.27
Port: 3306
I want to connect to my MySQL server via Python to have a database for my application.