Connecting MySQL
Connect a MySQL or MariaDB database to FreshGuard for monitoring.
MySQL requires a Starter plan or higher. Starter+
Connection Fields
| Field | Description | Example |
|---|---|---|
| Host | Hostname or IP address | db.example.com |
| Port | MySQL port (default 3306) | 3306 |
| Database | Database name | analytics |
| Username | Database user | freshguard_readonly |
| Password | User password | — |
| SSL | Enable SSL encryption | true |
Setup Steps
- In the FreshGuard dashboard, go to Sources and click Add Source.
- Select MySQL.
- Enter your host, port, database name, username, and password.
- Enable SSL if your server requires it (recommended for production).
- Click Test Connection to verify access.
- 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.usertable 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.
Recommended Setup
Create a dedicated read-only user for FreshGuard. See the MySQL: Read-Only User guide for the exact SQL commands.