Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
234 views
in Technique[技术] by (71.8m points)

php - Why MySQL connection is blocked of many connection errors?

As you can see I have a problem on a database connection. It gives me this error:

...is blocked because of many connection errors

I searched some answers but I couldn't solve my problem.

I don't know if I gave all the information that you need, so if you need something else, just tell me. I have a database connection from different computers and I had a user created to access the database but it had % in the hosts row, so I wanted to change it with an IP address for security issues and it gave me this error so now I'm stuck.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

MySQL blocks clients which error made while connecting to protect MySQL from malformed client.

So first, you need to find what sort of error is....

You might check MySQL error log in data directory. (typically hostname.err)

Or, you can increase max_connect_errors (what is current value?) maximum value depends on architecture. on 32 bit, 4294967295. 18446744073709547520 for 64 bit. (Manual)

mysql> SET GLOBAL max_connect_errors = 100000000;

But this is not real solution if error is frequently occurred.

FLUSH HOSTS can help you to eliminate blocked host right now.

mysql> FLUSH HOSTS;

If want to run from outside mysql console then use mysqladmin command:

# mysqladmin flush-hosts

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...