• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question Map Docker Container to plesk mysql localhost:3600

Brandon Turpin

Basic Pleskian
How can I access my mysql server within plesk from within my docker container. I have an asp.net core website that I am trying to connect to a MYSQL database that is hosted outside the container. I try and connect within my container to localhost:3306 and get an error that there are no servers found.

Mapping does not work since I port 3306 is already being used. And I would need multiple containers to connect to the same port. I am at a lost what to do.
 
Your question isn't clear but..
If you want to use a MySQL managed by Docker on Plesk Server
You need to open a new port on your host ex. 3307 (also open that port if you have a cloud firewall)

Add a new container
Manual Mapping: 3306 to external 3307
Volume Mapping: /Var/lib/mysql to /var/docker/mysql

Add Environment Variable :
Name: MYSQL_ROOT_PASSWORD
Value: add your MySQL root password

and in adding DB server .. use 127.0.0.1 on port 3307 instead of localhost:3306
 
Your question isn't clear but..
If you want to use a MySQL managed by Docker on Plesk Server
You need to open a new port on your host ex. 3307 (also open that port if you have a cloud firewall)

Add a new container
Manual Mapping: 3306 to external 3307
Volume Mapping: /Var/lib/mysql to /var/docker/mysql

Add Environment Variable :
Name: MYSQL_ROOT_PASSWORD
Value: add your MySQL root password

and in adding DB server .. use 127.0.0.1 on port 3307 instead of localhost:3306

Maybe I am doing something wrong. When I try and add a database server I get the following error

Host '172.17.0.1' is not allowed to connect to this MySQL server
 
Last edited:
Hi there, hope it is ok to extend this talk? I have the same error on Plesk Obsidian with ubuntu 18.04 LTS (vServer) and i read a lot but i can't find why i do not get access to the mysql server within docker from plesk:

Bildschirmfoto 2020-04-17 um 10.37.57.pngBildschirmfoto 2020-04-17 um 10.38.17.pngBildschirmfoto 2020-04-17 um 10.43.34.pngBildschirmfoto 2020-04-17 um 10.44.10.pngBildschirmfoto 2020-04-17 um 10.44.18.png

Would be great if anybody could give me a hint.

Many thanks!
c--
 

Attachments

  • Bildschirmfoto 2020-04-17 um 10.41.44.png
    Bildschirmfoto 2020-04-17 um 10.41.44.png
    37.5 KB · Views: 21
Back
Top