This topic is locked
[SOLVED]

  New project gives this error unblock with 'mysqladmin flush-hosts (FOLLOW UP)

5/28/2012 9:14:28 AM
PHPRunner General questions
S
sradforth author

I see this error on 25% of the projects I create from scratch and keep looking for the answer here first so thought I'd share my fix so can find it in future and hopefully help others perplexed by it.
The message

Warning: mysqli_connect() [function.mysqli-connect]: (HY000/1129): Host 'box8126.bluehost.com' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts' in /home6/blah/public_html/myproject/include/dbconnection.my.mysqli.php on line 13
Fatal error: Host 'box8126.bluehost.com' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts' in /include/dbconnection.my.mysqli.php on line 17


The issue is normally not due to a hosting issue as the other answer suggests, it's a generic 'mysql connection' failure message. This typically is the server can not find the MySQL db and returns this.
For me the issue is the host is unable to resolve my server name (myservername.com) and fails to connect. My solution was to change the server name to localhost and use the excellent php connect method PHPRunner offers.

(I.e. in PHPRunner, Click on tables screen and click 'Back'. Tick the Connect using PHP, upload the PHPRunner connection file, run the phprunner.php file in the webbrowser to make sure you can connect to the server.

Note: There is a bug if you type in the Port number it will duplicate on each postback (Watch the URL parameters to see what I mean). So leave Port blank.

Now you should be able to select your db from the dropdown list as before.

Finally click the 'Output' screen options and for 'Server Databse Connections' edit this and change your host from myservername.com to localhost so it reads $host="localhost";
That's it, ta-dah all works now.
If your localhost user doesn't exist or have DB permissions you'll see the same error too at a guess.