'The best security configuration to run MySQL opens for connection over the internet

I would like to install MySQL on a VPN instance (server) and I would like to connect to this MySQL over the internet. What's the best practice to achieve this solution? What's the best MySQL configuration for security because this DB will be visible from the internet? Thank you for your hints and suggestions.



Solution 1:[1]

There is no MySQL configuration that is sufficiently safe or secure to allow connections over the unprotected internet. Don't do it.

At all of my past jobs, we never exposed the MySQL port on the internet. We used firewalls and routers and VPN's, so MySQL was accessed only by clients within our secure network. That secure network may include different sites, but it was all routed over inter-site WAN links and VPN's, not over the unprotected internet.


Alas, today I just saw this report about insecure MySQL instances whose ports are exposed to the internet: https://www.bleepingcomputer.com/news/security/over-36-million-mysql-servers-found-exposed-on-the-internet/

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1