exa-Peggy
Moderator
Moderator

Table of Contents

Scope

When connecting to external network services from a database (e.g. via IMPORT/EXPORT commands or scripts), a user may get message unblock with 'mysqladmin flush-hosts'.

Diagnosis

select * from
(import from JDBC DRIVER='MySQL8' at MYSQL_TEST statement 'select * FROM dual');
Fails with:
SQL Error [ETL-5]: JDBC-Client-Error: Connecting to 'jdbc:mysql://u....com:3306' as user='user' failed: null, message from server: "Host 'xxx' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'" 

Explanation

Exasol has to communicate with the MySQL server. If Exasol receives an error message from MySQL server Exasol prints this messages. This message is caused by the MySQL server. 
In the example above it means the number of faulty connections is exceeded. 

Recommendation

You have to perform an unlock.

There are 2 possibilities:

  1. Run the following SQL statement in your MySQL SQL client (such as phpMyAdmin)::
    FLUSH HOSTS;
  2. If you have shell access to the server, you can login and do:
    mysql -u root -p -e 'flush hosts'

You can find out what causes these faulty connections in the MySQL error log file in the data directory. Now you can try to execute the command again.

In case of such an error message:

SQL Error [ETL-5]: JDBC-Client-Error: Connecting to 'jdbc:mysql://....com:3306' as user='user' failed: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

please refer to this Communications Link Failure with JDBC and MySQL (Case: No Connectivity issue) playbook: https://community.exasol.com/t5/tkb/workflowpage/tkb-id/Connect/article-id/80 

Additional References

 

We're happy to get your experiences and feedback on this article below! 

Version history
Last update:
‎19-08-2021 02:20 PM
Updated by:
Contributors