Click here to Skip to main content
15,922,166 members
Please Sign up or sign in to vote.
4.50/5 (2 votes)
See more:
When I try to use TcpClient to connect the remote MySQL server, I get following error message:

Host 'xxxxxxxx' is blocked because of many connection error; unblock with 'mysqladmin flush-hosts'


Do you know what is wrong? How can I fix it?

Here is my code
C#
TcpClient socketForServer = new TcpClient("xxxxx", 3306); 
NetworkStream networkStream = socketForServer.GetStream(); 
StreamReader streamReader = new StreamReader(networkStream); 
System.Console.WriteLine(streamReader.ReadLine());
Posted
Updated 18-Mar-11 15:09pm
v3
Comments
AspDotNetDev 18-Mar-11 15:30pm    
I think your error message is incorrect. I doubt the error message would say "because of many connection". Please correct it with the exact error message.
Wendelius 18-Mar-11 15:34pm    
I think the message is quite correct, just missing the plural form. But I agree the message is a bit weird :)
luckytree2011 18-Mar-11 15:35pm    
here is the complete message.
Host 'XXXXXXXXXXXXXXXXXXXXX'is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'
luckytree2011 18-Mar-11 15:43pm    
Here is my code

TcpClient socketForServer = new TcpClient("xxxxx", 3306);
NetworkStream networkStream = socketForServer.GetStream();
StreamReader streamReader = new StreamReader(networkStream);

System.Console.WriteLine(streamReader.ReadLine());
AspDotNetDev 18-Mar-11 16:03pm    
Click "Improve question" to update the error message and add the code you are using.

 
Share this answer
 
Comments
Dalek Dave 18-Mar-11 21:23pm    
Good link.
It simply means that you have reached the connection error limit that is defined in max_connect_errors variable.

Could be a config setting on your database though.

Refer to this article for tweaking your config file.

http://dev.mysql.com/doc/refman/5.0/en/blocked-host.html[^]
 
Share this answer
 
Comments
Dalek Dave 18-Mar-11 21:23pm    
Sage Advice.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900