How to Prevent Blocked Host Connection from Many Connection Errors in MySQL

MySQL has a parameter called max_connect_errors to prevent user from connecting to the database if they make too many connection errors (e.g. from wrong password) for security reason. The default for this value is 10. In case of AWS RDS, I don’t think the value is set. Therefore, when you are trying to connect to MySQL without changing this parameter, you will get the error message below.

Host ‘’ is blocked because of many connection errors; unblock with ‘mysqladmin flush-host’.

It also has a similar parameter called max_error_count. If a user makes more errors than this value, they will be blocked and get the same host blocked error.

The solution to prevent this error from happening is simple. Increase max_connect_errors and max_error_count.

First of all, you can check these variables with SQL commands

1
2
SHOW VARIABLES LIKE 'max_connect_errors';
SHOW VARIABLES LIKE 'max_error_count';

You can increase the value

1
2
SET Global max_connect_errors=100000;
SET Global max_error_count=10000;

In AWS RDS, you can manually edit the parameter group for the instance. This is especially useful when you get the error and locked out from accessing the database as you do not have the direct host access for RDS.

Git
How to specify which Node version to use in Github Actions

When you want to specify which Node version to use in your Github Actions, you can use actions/setup-node@v2. The alternative way is to use a node container. When you try to use a publicly available node container like runs-on: node:alpine-xx, the pipeline gets stuck in a queue. runs-on is not …

AWS
Using semantic-release with AWS CodePipeline and CodeBuild

Here is the usual pattern of getting the source from a git repository in AWS CodePipeline. In the pipeline, we use AWS CodeStart to connect to a repo and get the source. Then, we pass it to the other stages, like deploy or publish. For some unknown reasons, CodePipeline downloads …

DBA
mysqldump Error: Unknown table ‘COLUMN_STATISTICS’ in information_schema (1109)

mysqldump 8 enabled a new flag called columm-statistics by default. When you have MySQL client above 8 and try to run mysqldump on older MySQL versions, you will get the error below. mysqldump: Couldn’t execute ‘SELECT COLUMN_NAME, JSON_EXTRACT(HISTOGRAM ‘$”number-of-buckets-specified”‘) FROM information_schema.COLUMN_STATISTICS WHERE SCHEMA_NAME = ‘myschema’ AND TABLE_NAME = ‘craue_config_setting’;’: Unknown …