• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Issue Access Mysql from Docker

Phthisicus

New Pleskian
Hi Everyone,

I am trying to connect to the build in MySQL server of Plesk from a Docker container. But i get the following messages:

Could not connect to MySQL database at 10.0.0.100: Access denied for user 'user'@'172.17.0.2'

I am able to login to the MySQL server with that user from other networks even external exept from within the docker container.
The user also has '%' access permissions. I configured the my.cnf of mysql to bind it to :: so every ipv4 and ipv6 adress is able to connect to it.

Is there something i am missing?
 
- Start your MySQL docker from the Command Line as Root

docker run --name=mysql8 -v /path/mysql/datadir:/var/lib/mysql -v /root/mysql8/conf.d:/etc/mysql/conf.d -e MYSQL_ROOT_PASSWORD=RootPassword -p 127.0.0.1:3307:3306 -p 127.0.0.1:33061:33060 "mysql:latest"

- Add the new Database Server to the Plesk via Tools & Settings > Database Servers - Host - 127.0.0.1

- In a Subscription, When you are creating a new database on this new DB server, Select Allow remote connections from any host

This docker is BInd to the Localhost, It will not be accessible externally.
 
Additionally to the above post,

-v for Volume Mapping

-p for Port Mapping

$mysql -h 127.0.0.1 -P 3307 -u user_name -p

Or in your application config file, Eg - 'host' => '127.0.0.1:3307' (Magento 2)
 
A late follow up but hopefully useful to someone..

On Plesk 18, Docker instances can't access the main Plesk DB server locally. Therefore you need to set the DB Host as the server's public IP and ensure all firewalls allow traffic through (both on Plesk and on any network firewall). Furthermore, this was the critical setting that we found needed to be turned on:

Screenshot 2024-07-16 at 21.34.56.png

In our case we're trying to get wiki.js running on docker - but using the standard mariadb server.
 
I might be wrong.. but the docker instant should be able to access the Local DB without above option or the firewall settings. I have done this before.

Did you try both localhost and 127.0.0.1 for the DB settings in your Docker Instant?

By the way which docker is this?
 
Sorry, I didn't mention this in my above post.

Please try this.

Create this docker via command line.

Code:
#docker run --network host --name=Wiki requarks/wiki

Then the settings.

Firefox_Screenshot_2024-07-17T01-25-26.278Z.png


You should be able to connect to local DB without allowing local DB to connect from external connections or the firewall changes.
 
This does not work for passbolt. I get bind errors like this:
Code:
nginx: [emerg] still could not bind()
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)

I gave up... I often give up using Plesk...
 
This does not work for passbolt. I get bind errors like this:
Code:
nginx: [emerg] still could not bind()
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)

I gave up... I often give up using Plesk...

This is unrelated to the Plesk. The Ports 80 and 443 have been already used by NGINX as expected.

I haven't tried this Docker myself. Please refer to the https://hub.docker.com/r/passbolt/passbolt/
 
Back
Top