How to Fix MySQL Error 10055
Posted on Sep 5, 2013 by
Paul WhiteBefore launching a new social networking website for my client I had some doubts on if my server could handle it. The old site was primitive by today's standards. The new site was full of AJAX calls that would refresh elements on the page behind the scenes. However this was bound to put my Database Server under a heavier load than it was used to.
After launching the new site everything was going well. But once our members starting loggin in, we started to get this error from all sites on the box.
ERROR HY000 MySQLODBC 5.1 DriverCan't connect to
MySQL server on 'localhost' (10055) ERROR HY000 MySQLODBC 5.1 DriverCan't connect to
MySQL server on 'localhost' (10055)
Background on my Server
Dual 3.6 Ghz Intel Xeons ( 90 nm )
4 x 146GB 15K
SAS Drives in
RAID 10 on a
Dedicated RAID Controller with 256 MB RAM
16 GB Memory
Software
Windows Server 2008 R2
SmarterMailSmarterStats
MySQL 5.1
Running about 80
Websites.
What is the Cause of MySQL Error 10055?
The truth is this is more of an Operating System Error than a
MySQL error. Each time your website runs a query you open a connection to the Database, run the query, then close the connection. Each time this happens your Server allocates a dynamic port for use by
MySQL and your Website. For
Websites like mine which may run 2000+ Queries per second, this means that 2000+ dynamic ports must be set asside for these connections. Sometimes your server gets under load and the operating system can't recycle these ports fast enough, leading you to run out of ports and then your server throws a 10055 Error.
By default
Windows Server 2008 R2 has 16838 Ports designated for Dynamic use. The default ranges are 49152 - 65535. However this can be extended to a wider range of ports.
How to Fix MySQL Error 10055
To fix the problem you need to increase the number of dynamic ports.
Running the following Commands will give give you 50000 ports for dynamic use.
On
Windows Server 2008 R2
Open command Prompt
Type the following
netsh int ipv4 set dynamicport tcp start=10000 num=50000
Press Enter
Type the following
netsh int ipv4 set dynamicport udp start=10000 num=50000
Press Enter
Type the following
netsh int ipv6 set dynamicport tcp start=10000 num=50000
Press Enter
Type the following
netsh int ipv6 set dynamicport udp start=10000 num=50000
Press Enter
Conclusion
Every Since running these commands, I haven't had a single instance of
MySQL 10055 Errors.
Hope this helps others with similar problems.
32542 Visitors
32542 Views
Hi,
Thanks for sharing this article, you saved me from a big trouble and actualling bringing up my server without silly re-installations and setups.
I would like to know if there are any security or DDOS potential threats by increasing the number of dynamic ports for tcp and udp.
Best Regards,