Skip to content
  • Solutions
    By Role
    • For Developers
    • For Content Managers
    • For Agencies
    • For IT Admins
    • For Web Hosters
    • For Developers
    • For Content Managers
    • For Agencies
    • For IT Admins
    • For Web Hosters
    By Infrastructure
    • Overview
    • AWS
    • Microsoft Azure
    • Alibaba Cloud
    • Google Cloud Platform
    • Vultr
    • Overview
    • AWS
    • Microsoft Azure
    • Alibaba Cloud
    • Google Cloud Platform
    • Vultr
    • Digital Ocean
    • Linode
    • Upcloud
    • Oracle
    • OVH
    • Digital Ocean
    • Linode
    • Upcloud
    • Oracle
    • OVH
  • Product
    • Plesk Features
    • Plesk Editions
    • What’s new
    • Pricing
    • Roadmap
    • Lifecycle Policy
    • Extensions Catalogue
  • Pricing
  • Extensions
    Featured Extensions
    • SocialBee
    • WP Toolkit
    • Sitejet Builder for Plesk
    • SEO Toolkit
    • Joomla! Toolkit
    • Premium Email
    • Email Security
    • SocialBee
    • WP Toolkit
    • Sitejet Builder for Plesk
    • SEO Toolkit
    • Joomla! Toolkit
    • Premium Email
    • Email Security
    Bundles and packs:
    • Business and Collaboration Edition
    • WP pack
    • Hosting pack
    • Power pack
    • Language pack
    • Business and Collaboration Edition
    • WP pack
    • Hosting pack
    • Power pack
    • Language pack

    See all Extensions

  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
  • Pricing
  • Solutions
    • By Role
      • For Developers
      • For Content Managers
      • For Agencies
      • For IT Admins
      • For Web Hosters
    • By Infrastructure
      • Overview
      • Plesk on Amazon Web Services (AWS & Lightsail)
      • Microsoft Azure
      • Alibaba Cloud
      • Google Cloud Platform
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
      • Oracle
      • OVH
  • Products
  • Pricing
  • Extensions
    • Featured Extensions
      • SocialBee
      • WP Toolkit
      • Sitejet Builder for Plesk
      • SEO Toolkit
      • Joomla! Toolkit
      • Premium Email
      • Email Security
    • Bundles and packs:
      • Business and Collaboration Edition
      • WP pack
      • Hosting pack
      • Power pack
      • Language pack
      • See all Extensions
  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate Program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
  • Pricing
  • Solutions
    • By Role
      • For Developers
      • For Content Managers
      • For Agencies
      • For IT Admins
      • For Web Hosters
    • By Infrastructure
      • Overview
      • Plesk on Amazon Web Services (AWS & Lightsail)
      • Microsoft Azure
      • Alibaba Cloud
      • Google Cloud Platform
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
      • Oracle
      • OVH
  • Products
  • Pricing
  • Extensions
    • Featured Extensions
      • SocialBee
      • WP Toolkit
      • Sitejet Builder for Plesk
      • SEO Toolkit
      • Joomla! Toolkit
      • Premium Email
      • Email Security
    • Bundles and packs:
      • Business and Collaboration Edition
      • WP pack
      • Hosting pack
      • Power pack
      • Language pack
      • See all Extensions
  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate Program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
Plesk 360 login
Free Trial

Knowledge Base

How to create a MySQL server running in a Plesk Docker extension container and add it as an external database server in Plesk?

 
applications extensionsdatabasedatabase serverdbdocker

Question

  • How to add a MySQL server ran in a docker container as a remote database server?
  • How to create a MySQL server running in a Plesk Docker extension container and add it as an external database server in Plesk?

Answer

  1. Log into your server via SSH
  2. Create the directory /var/docker/mysql by executing the following command:

    # mkdir -p /var/docker/mysql/

  3. Log into Plesk
  4. Go to Docker
  5. Type mysql in the search box

    Note: The steps here are for a Docker container running MySQL version 8.3.0

  6. Press Run (local)
  7. Check the Automatic start after system reboot box
  8. Uncheck the Automatic port mapping box
  9. Uncheck a private port on the host, set external port 3306 to external port 3307 and internal port 33060 to external port 33070

    Note:

    Make sure ports 3307 and 33070 are open in all firewalls for your Plesk server's public IP address

  10. Set Volume mapping for Container to /var/lib/mysql and to Host to /var/docker/mysql

    Warning: Not mapping /var/lib/mysql  to /var/docker/mysql creates risk of losing data on the container's recreation.

  11. Add MYSQL_ROOT_PASSWORD as a new Environment variable (in order to set a new password for the root user of MySQL in this container) and enter a password that you would like to use as the Value:

  12. Press OK
  13. When the container starts, log into via the server SSH terminal and fix the issue outlined on this page: mysql - Authentication plugin 'caching_sha2_password' cannot be loaded - Stack Overflow

    # docker exec -it mysql bash
    # mysql -p
    # mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'YOUR_MYSQL_SERVER_PASSWORD';
    # mysql> exit

  14. Add your MySQL Docker container as an external database in Plesk by using the information on the following page of the Plesk Obsidian documentation:

    Note: Make sure you use the public IP of the server and the external port that you have used (3307 in this example)

    Adding Remote Database Servers to Plesk | Adding and Removing Database Servers | Plesk Obsidian documentation

  15. If you are planning to use this DB server as Default, go to Tools & Settings > Database Servers > Settings > Default settings for remote access of database users, and make sure access from remote servers is allowed. (This server would be a remote DB server even though it is hosted on the same VM).

Tweet
Share
Share
Email
0 Shares
Read the full article
Related Posts

Plesk with Centralized Database and Network File System

Read More »

The Plesk HoliDeals Calendar is here (Part 2)

Read More »

Containers vs Virtual Machines – What Is The Difference?

Read More »
Knowledge Base

Plesk repair db shows an error: There is no IP pool with ID 0

Read More »

 An operation fails in Plesk: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘X’ for key ‘PRIMARY’

Read More »

How to enable remote access to MySQL/MariaDB server in Plesk?

Read More »

Unable to list APS applications: Search results could not be loaded at the moment

Read More »

Hosting Wiki

  • Django
  • Docker
  • DBMS Interface
  • DB2
  • Server Redundancy
  • DBMS
  • VMmanager
  • Google Cloud CDN
  • AMP
  • Bare Metal Server
  • MySQL
  • SolusVM
  • PowerVM
  • Oracle VM Server
  • VMware
  • Server Virtualization Software
  • Windows Server
  • Linux
  • JavaScript
  • IBM DB2
  • ODBC
  • MongoDB
  • DBA
  • SQL
  • Plesk
  • SQL database
  • NoSQL Database
  • Web Server
  • DNS Server
  • IPv6
  • IPv4
  • SIP
  • SSH
  • UDP/IP
  • TCP/IP
X-twitter Linkedin Youtube Reddit Github
  • Product
  • Login
  • Pricing
  • Editions
  • For Partners
  • Partner Program
  • Contributor Program
  • Affiliate Program
  • Plesk University
  • Company
  • Blog
  • Careers
  • Events
  • About Plesk
  • Our Brand
  • Resources
  • User and Admin guides
  • Help Center
  • Migrate to Plesk
  • Contact Us
  • Hosting Wiki
  • Forum
  • Legal
  • Legal
  • Privacy Policy
  • Imprint

© 2025 WebPros International GmbH

Part of the WebPros®  Family