Skip to main content

Connecting MySQL

Connect a MySQL or MariaDB database to FreshGuard for monitoring.

MySQL requires a Starter plan or higher. Starter+

Connection Fields

FieldDescriptionExample
HostHostname or IP addressdb.example.com
PortMySQL port (default 3306)3306
DatabaseDatabase nameanalytics
UsernameDatabase userfreshguard_readonly
PasswordUser password
SSLEnable SSL encryptiontrue

Setup Steps

  1. In the FreshGuard dashboard, go to Sources and click Add Source.
  2. Select MySQL.
  3. Enter your host, port, database name, username, and password.
  4. Enable SSL if your server requires it (recommended for production).
  5. Click Test Connection to verify access.
  6. Save.

Warning

Always enable SSL for production databases. Unencrypted connections send credentials in plaintext.

Common Issues

Connection Timeout

  • Verify your database is accessible from the internet (or from FreshGuard’s outgoing IPs — find them in Settings → Network).
  • Check firewall rules and security groups to allow inbound connections on your MySQL port.
  • If your database is in a private network, consider setting up a bastion host or VPN.

Authentication Failed

  • Confirm the username and password are correct.
  • Ensure the user has been granted access from external hosts (MySQL defaults to localhost-only access).
  • Check that the mysql.user table allows connections from FreshGuard’s outgoing IPs (find them in Settings → Network).

SSL Required

If you see SSL-related errors, enable the SSL toggle in the connection form. If your server uses a self-signed certificate, you may need to configure certificate trust on the server side.

Create a dedicated read-only user for FreshGuard. See the MySQL: Read-Only User guide for the exact SQL commands.