Error: Unable To Validate Certificate. Connection to the MySQL Database Failed
Issue
Connector setup tests fail. The following errors appear:
Unable to validate certificate. Failure(origin=(informer=(type=connector, externalName=MySQL Connector), server=(name=MySQL, type=SOURCE)), code=transport/db_connection_failure, message=Connection to the MySQL database failed.)
Test connection exception with cause: Host 'xxx.xxx.xxx.xxx' is not allowed to connect to this MySQL server
Environment
Connector: MySQL
Resolution
To resolve this issue, do the following:
- Safelist the host IP address referenced in the error message in your firewall settings.
- Check your MySQL server configuration to ensure that it allows connections from the IP address referenced in the error message.
- Run the following SQL command on your MySQL server:
SELECT host FROM mysql.user WHERE user = '<username>';
- Check whether the response includes either the applicable IP address or
%
, which means connections are allowed from any IP address.
- Run the following SQL command on your MySQL server:
- If your configuration doesn't allow connections from the applicable IP address, grant the user permission to connect from it by running the following SQL commands:
GRANT ALL PRIVILEGES ON <database>.* TO '<username>'@'%' IDENTIFIED BY '<password>';
FLUSH PRIVILEGES;
- Restart the MySQL service to apply the new settings.
- In Fivetran, test your connector again.
Cause
This issue occurs when the MySQL server rejects connections from the IP address referenced in the error message due to insufficient permissions or incorrect configuration settings.