Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

We have MySQL v5.5.25 running on Windows Server 2008 R2. Occasionally people are unable to connect, and the only way we have found to fix this is to restart the mysql service. This happens every 2-3 days.

Anyone have a clue on this? We have spent hours trying to fix it changing various values in the configuration, but nothing has worked.

share|improve this question
    
Have you looked in the log files? Difficult to help without anything more specific. –  FreshPhilOfSO Dec 17 '13 at 10:47
    
There is nothing in the general logfile related to this. But i can add that when the problem occurs, we can still connect using MySQL Workbench. We have some vb6 direct.dll integration and it seems that is the one failing. Are there any known bugs in that area? –  Jac Dec 17 '13 at 11:09
    
Any sort of error message, from the application, perhaps? Setting log_warnings = 2 in config may increase the likelihood of getting some logging to explain failed connections. This goes to the error log, as opposed to the general log. –  Michael - sqlbot Dec 17 '13 at 12:54
add comment

2 Answers

You can monitor the output of these queries:

show full processlist; and show global status like 'max_used_connections';

You can edit configuration file my.ini and increase max_connections value and give a try.

share|improve this answer
add comment

Please keep in mind what the MySQL Documentation says about max_connect_errors

If more than this many successive connection requests from a host are interrupted without a successful connection, the server blocks that host from further connections. You can unblock blocked hosts by flushing the host cache. To do so, issue a FLUSH HOSTS statement or execute a mysqladmin flush-hosts command. If a connection is established successfully within fewer than max_connect_errors attempts after a previous connection was interrupted, the error count for the host is cleared to zero. However, once a host is blocked, flushing the host cache is the only way to unblock it.

MySQL 5.5's default value for max_connect_errors is 10.

I have two suggestions on resetting the connection error count errors besides restarting mysql:

SUGGESTION #1

Create a one line SQL script (such as C:\FlushHosts.sql)

Setup a scheduled task to execute mysql -uroot < C:\FlushHosts.sql every hour

SUGGESTION #2

Goto my.ini and add the following line

[mysqld]
max_connect_errors=18446744073709547520

Then, login to mysql client and run this:

mysql> SET GLOBAL max_connect_errors = 18446744073709547520;

After setting max_connect_errors this high, you should never get connection errors. Otherwise, you must running mysql in some parallel universe.

Give it a Try !!!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.