Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 8th October 2006, 17:54
KenKnight KenKnight is offline
Senior Member
 
Join Date: Nov 2005
Posts: 137
Thanks: 0
Thanked 3 Times in 2 Posts
Default localhost.localdomain is blocked : mysql

Hi all,

I've got a client with one of the debian sarge setup and after a few hours when you try to login to ispconfig you get the following error;

Host 'localhost.localdomain' is blocked because of many connection errors. Unblock with 'mysqladmin flush-hosts'

it is referencing a php file below /home/admispconfig

Once I issue the flush-hosts everything works fine for a while. Another note is it doesn't seem to affect other php/mysql applications.

Any suggestions. I'm not finding any logs that have any meaningful entires.

Cheers!
Ken
Reply With Quote
Sponsored Links
  #2  
Old 9th October 2006, 15:00
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,740 Times in 2,575 Posts
Default

What's the exact error message?

Quote:
Originally Posted by KenKnight
Another note is it doesn't seem to affect other php/mysql applications.
ISPConfig uses its own Apache and PHP, that's why it doesn't affect other PHP applications.

Quote:
Originally Posted by KenKnight
I'm not finding any logs that have any meaningful entires.
You can check the logs in /root/ispconfig/httpd/logs.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 9th October 2006, 22:59
KenKnight KenKnight is offline
Senior Member
 
Join Date: Nov 2005
Posts: 137
Thanks: 0
Thanked 3 Times in 2 Posts
Default

Hi Falko,

Here's a copy of the error in the browser;

Warning: mysql_connect() [function.mysql-connect]: Host 'localhost.localdomain' is blocked because of many connection errors. Unblock with 'mysqladmin flush-hosts' in /home/admispconfig/ispconfig/lib/classes/ispconfig_db_mysql.lib.php on line 77

As soon as I do the flush-hosts command everything will work fine.

Also, the ispconfig_access_log is showing nothing but stand http GET commands on various files of the site.

Cheers!
Ken
Reply With Quote
  #4  
Old 10th October 2006, 14:50
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,740 Times in 2,575 Posts
Default

Quote:
Originally Posted by KenKnight
Also, the ispconfig_access_log is showing nothing but stand http GET commands on various files of the site.
Did you check the logs in /root/ispconfig/httpd/logs, especially the error log?

These links might help you: http://developer.spikesource.com/wik...nection_errors
http://dev.mysql.com/doc/refman/5.0/...cked-host.html
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 8th January 2007, 09:48
Ovidiu Ovidiu is offline
Senior Member
 
Join Date: Sep 2005
Posts: 1,262
Thanks: 78
Thanked 24 Times in 20 Posts
Default

I have a somewhat similar problem, today a clients website showed this error:

Quote:
Coppermine critical error:
Unable to connect to database !

MySQL said: Host 'localhost' is blocked because of many connection errors. Unblock with 'mysqladmin flush-hosts'
when he was trying to access his gallery. after a flush-hosts all is fine...

my munit and hotsanic tools do not show any big traffic, neither mysql accesses...

any clues how to avoid this?
Reply With Quote
  #6  
Old 9th January 2007, 15:07
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,740 Times in 2,575 Posts
Default

Are there any errors in your logs?
Did you have a power failure, or was the system reset?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #7  
Old 9th January 2007, 16:26
pdoes pdoes is offline
Junior Member
 
Join Date: Jan 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

When you get this error message it means that mysqld has gotten a lot (max_connect_errors) of connect requests from the host 'hostname' that have been interrupted in the middle. After max_connect_errors failed requests, mysqld assumes that something is wrong (like an attack from a cracker), and blocks the site from further connections until someone executes the command mysqladmin flush-hosts.

By default, mysqld blocks a host after 10 connection errors. You can easily adjust this by starting the server like this:

shell> safe_mysqld -O max_connect_errors=10000 &

Note that if you get this error message for a given host, you should first check that there isn't anything wrong with TCP/IP connections from that host. If your TCP/IP connections aren't working, it won't do you any good to increase the value of the max_connect_errors variable!

Hope this helps
Peter
Reply With Quote
  #8  
Old 9th January 2007, 22:20
Ovidiu Ovidiu is offline
Senior Member
 
Join Date: Sep 2005
Posts: 1,262
Thanks: 78
Thanked 24 Times in 20 Posts
Default

well I have not enabled logging for mysql, I'll do that next thing in the morning. no other relevant logs.

regarding max connection errrors: the databases are only accesse from localhost... so connections are ok ;-)
Reply With Quote
  #9  
Old 10th January 2007, 04:17
pdoes pdoes is offline
Junior Member
 
Join Date: Jan 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The fact that the database is accessed locally doesn't mean it doesn't use TCP connections which means you can't assume they are OK, cause your error message states something is wrong.

I'm not saying the connection itself is faulty, like a faulty switch somewhere, but you could get aborted connections because people are tired of waiting and shut down their browser, or people keep hitting the refresh button on the browser, which opens a new connection to MySQL and so overflowing the connections.

If the site is visited a lot the default of 10 errors is reached easily especially if it's a shared databases by more then one program, Like Gallery and Php-nuke together.

Peter
Reply With Quote
  #10  
Old 10th January 2007, 09:31
Ovidiu Ovidiu is offline
Senior Member
 
Join Date: Sep 2005
Posts: 1,262
Thanks: 78
Thanked 24 Times in 20 Posts
 
Default

forgive my ignorance, I modified the max connect errors to 100 - I'll see how this works out.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
postfix problems with smtp linkdeb Server Operation 13 15th March 2014 17:58
I'm dying! m u r Installation/Configuration 41 17th September 2006 13:44
Can't Remote Access mysql 4.1 dedibox Installation/Configuration 2 24th August 2006 10:32
Mandriva 10.2 Perfect Setup Install Problems... ctroyp Installation/Configuration 12 30th December 2005 16:04
Im thinking about throwing proftpd to the trashcan danf.1979 Installation/Configuration 2 23rd December 2005 09:27


All times are GMT +2. The time now is 07:11.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.