MySQL phpMyAdmin Connections Aborted

MySQL database - Apache web server
In phpMyAdmin under Connections the line for Aborted reads 510K, 25.18K per hr, 167.34%.
What does this mean? What is the mostly likely cause?
LVL 1
ClawfootSupplyAsked:
Who is Participating?
 
Aleksandar BradarićConnect With a Mentor Software DeveloperCommented:
It seems you'r enot doing anything wrong... You might want to set the `log_warnings` value to 2 in order to log the aborted connection warnings into the error log file. This might give you more info.
0
 
mankowitzCommented:
Aborted connectections are when a connection packet doesn't contain the right information,  the user didn't have privileges to connect to a database (or wrong password) or takes more than connect_timeout to connect.
0
 
Aleksandar BradarićSoftware DeveloperCommented:
Most likely you have a script which does not close connections. These are timing out and are aborted.
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
Aleksandar BradarićSoftware DeveloperCommented:
0
 
ClawfootSupplyAuthor Commented:
The queries are running fine on the site but the aborted connections keeps growing. It sounds like, as you have said that the script is not closing the connection and that it is timing out, but I have put my connections into classes and close the connection in the destructor. Shouldn't this be called at the end of the script?
0
 
Aleksandar BradarićSoftware DeveloperCommented:
You might try freeing the objects manually and see if it changes anything.
0
 
ClawfootSupplyAuthor Commented:
I put echo 'hello' in the constructor where the connection is opened and echo 'good-bye' in the destructor where the connection is closed and I am always getting matching hello's and good-bye's. The max allowed packet is set at 1M. Is this too small? If it is too small then why do all of the queries seem to run fine?
0
 
Aleksandar BradarićSoftware DeveloperCommented:
> The max allowed packet is set at 1M. Is this too small? If it is too small then why do all of the queries seem to run fine?

If you've never received the error message saying the data packet was too big, then it's not the max_allowed_packet either. What about the `Failed attempts` values in phpMyAdmin?
0
 
ClawfootSupplyAuthor Commented:
Failed Attempts = 13 after 1.7M queries
0
 
jentulmanCommented:
is mysql accessible by tcp/ip from external hosts?

It could be that it is getting regular scans from bots looking for open database servers on the web.
0
 
ClawfootSupplyAuthor Commented:
Yes, it is open to tcp/ip from external hosts. We connect to it using mysql browser. Can bots scan 43K per hour? Is this a problem? Should I restrict this to specific ips? How?
0
 
jentulmanConnect With a Mentor Commented:
Depends on the number of bots :)

I would strongly suggest restricting access to only known ip's if at all possible even if it doesn't actually solve this problem. New exploits are discovered all the time and there is always the chance that you server wont be patched against one and then exploited at a later date.
Although you can set a mysql user to only be allowed to log in from a particular ip the restriction should occur at your networks firewall. The idea is to block the actual ip traffic from the machine entirely from unkown hosts to reduce the risk of exploits being run.
If the box is being scanned in some way the firewall block should then cuase a noticable driop in failed connection attempts.
As i say even if these failures are not related to this it is still good security to prevent unnessacary access to any machine from unknown hosts.
0
 
ClawfootSupplyAuthor Commented:
I was using stored procedures with prepared statements and mysqli. Any time you get a result set back you need to call next_result() until it is false on the connection object before you close it or it will abort the connection.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.