0
$con1 = mysql_connect("xxx", "yyy", "zzz",'xyz');

$data = mysql_query("SELECT department_name,id,status FROM xyz.department");
$values = Array();
while ($row = mysql_fetch_assoc($data)) {
  echo  $row['department_name'] = mysql_real_escape_string($row['department_name']); }

Warning: mysql_connect() [function.mysql-connect]: Host 'xyz' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts' in C:\xampp\htdocs\hi.php

I am using Xampp Server.

hakre
  • 193,403
  • 52
  • 435
  • 836
Akhila Prakash
  • 481
  • 4
  • 17
  • And which script do you use to produce this error? – Rizier123 Feb 23 '15 at 07:14
  • database connection $con1 = mysql_connect("xxx", "yyy", "zzz","xyz"); – Akhila Prakash Feb 23 '15 at 07:16
  • Please edit your question and show us your **full** and **real** code! (You can indeed use pseudo data for the connection) – Rizier123 Feb 23 '15 at 07:17
  • now check edited question . – Akhila Prakash Feb 23 '15 at 07:20
  • Is this your entire code? Also could it be that you have multiple connections? Since the name of the connection is `$con1`? Also where do you close the connection? Add error reporting: `` at the top of your file(s) and tell us if you get any errors – Rizier123 Feb 23 '15 at 07:23
  • Warning: mysql_connect() [function.mysql-connect]: Host 'xyz' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts' in C:\xampp\hi.php Could not connect : Host 'xyz' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts' – Akhila Prakash Feb 23 '15 at 07:43
  • Try just to restart your MySQL server. Or use this `FLUSH HOSTS;` In your input query browser in phpmyadmin – Rizier123 Feb 23 '15 at 07:45
  • **Warning**: You are using [an **obsolete** database API](http://stackoverflow.com/q/12859942/19068) and should use a [modern replacement](http://php.net/manual/en/mysqlinfo.api.choosing.php). – Quentin Mar 29 '15 at 00:15

1 Answers1

1

You need to run:

mysqladmin flush-hosts

Against your MySQL server.. or restart it will work also.

See: http://dev.mysql.com/doc/refman/5.6/en/blocked-host.html

Trent Lloyd
  • 1,832
  • 1
  • 15
  • 13