Reputation: 258
My website is working perfectly on a localhost 'Wamp' server. However, as soon as I upload it to my web host for others to use, I get the following error:
Host 'stats.starfish.arvixe.com' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'
I cannot perform a 'flush-hosts' command, since I am using a shared host and lack the privileges.
I've searched extensively online, and I can't find a solid answer as to what may be causing my connection errors. The site works for a bit, but as soon as multiple people start using it, MySQL blocks my web host because it has too many connection errors.
Is there any sort of log I can access or view that may inform me as to what is causing the connection error?
Upvotes: 16
Views: 15550
Reputation: 744
https://dev.mysql.com/doc/refman/5.0/en/blocked-host.html
Your problem is that you are continually attempting to connect and you are failing. The shared server is set to protect itself from this behavior, and has cut you off. Turn off your application for a while and then resolve the connection problem before turning it back on.
The amount of time before you are able to attempt again is set on the server, likely in a place you can not see. So try every 15 minutes for a while until you are allowed the attempt ...
I would suggest a spare mysql server (perhaps locally) to practice with so you can avoid what appears to this host as a brute force attack in the future. Always test your connection manually before "turning on the service".
Upvotes: 3
Reputation: 128
Use "localhost" as db host, if your website is hosted at the same server of the db
Upvotes: 0
Reputation: 4126
I had the same problem. But I solved it like this:
Login to your "Domain Admin Panel" (www.yourdomainname.com/cpanel
)
Go to "Databases" section and click on "Remote Mysql" option
In the next page, in "Host (% wildcard is allowed)" text field put "%"
and press "Add Host" button
Now you should see that "%"
in the below list and from there you can delete it by pressing "X" button any time.
Now go to your "php Script" file and set your Database Host Name, Without "http://"
or "www"
Now try to reconnect it. Hope it will help you.
Remember:
By doing this, You are allowing external web servers to access your MySQL databases by adding their domain name to the list of hosts that are able to access databases on your web site.
Upvotes: 0