?
Solved

MySQL phpMyAdmin Connections Aborted

Posted on 2007-08-02
13
Medium Priority
?
1,410 Views
Last Modified: 2013-12-12
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?
0
Comment
Question by:ClawfootSupply
  • 5
  • 5
  • 2
  • +1
13 Comments
 
LVL 24

Expert Comment

by:mankowitz
ID: 19619048
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
 
LVL 17

Expert Comment

by:Aleksandar Bradarić
ID: 19619050
Most likely you have a script which does not close connections. These are timing out and are aborted.
0
 
LVL 17

Expert Comment

by:Aleksandar Bradarić
ID: 19619056
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 1

Author Comment

by:ClawfootSupply
ID: 19619213
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
 
LVL 17

Expert Comment

by:Aleksandar Bradarić
ID: 19619317
You might try freeing the objects manually and see if it changes anything.
0
 
LVL 1

Author Comment

by:ClawfootSupply
ID: 19620041
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
 
LVL 17

Expert Comment

by:Aleksandar Bradarić
ID: 19620169
> 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
 
LVL 1

Author Comment

by:ClawfootSupply
ID: 19620191
Failed Attempts = 13 after 1.7M queries
0
 
LVL 17

Accepted Solution

by:
Aleksandar Bradarić earned 750 total points
ID: 19620253
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
 
LVL 4

Expert Comment

by:jentulman
ID: 19620649
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
 
LVL 1

Author Comment

by:ClawfootSupply
ID: 19620747
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
 
LVL 4

Assisted Solution

by:jentulman
jentulman earned 750 total points
ID: 19621380
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
 
LVL 1

Author Comment

by:ClawfootSupply
ID: 19628079
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

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question