Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the mysql connection error code 10048

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces "how to solve mysql connection error code 10048". In daily operation, I believe many people have doubts about how to solve the problem of mysql connection error code 10048. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "how to solve mysql connection error code 10048". Next, please follow the editor to study!

The solution to Can't connect to MySQL server on 'localhost' (10048) is generally found in 2003 servers using mysql.

The cause of the error:

Applications need to release and create new connections quickly, but lower throughput because connections in TIME_WAIT exceed the default values.

Solution:

The registry keys of two windows closely related to this error: the values of TcpTimedWaitDelay and MaxUserPort.

The time that must elapse before TcpTimedWaitDelay determines that TCP/IP can release closed connections and reuse its resources. The interval between shutdown and release is commonly referred to as the TIME_WAIT state or twice the maximum life cycle (2MSL) state. During this time, reopening a connection to the client and server is less expensive than establishing a new connection. Reducing the value of this entry allows TCP/IP to release closed connections faster, providing more resources for new connections.

MaxUserPort determines the maximum number of ports to be used when requesting any available user port from the system, and the highest port number that TCP/IP can specify. If the maximum port connection for establishing a TCP connection is greater than 5000, the local computer responds to the following error message WSAENOBUFS (10055): the 10048 error of the application is caused because the system does not have enough buffers or cannot perform socket operations because the queue is full.

Open Registry Editor regedit

TcpTimedWaitDelay settings:

Locate the HKEY_LOCAL_MACHINE\ SYSTEM\ CurrentControlSet\ Services\ TCPIP\ Parameters registry subkey

And create a new REG_DWORD value named TcpTimedWaitDelay

Set this value to decimal 30 and hexadecimal to 0 × 0000001e

The wait time for this value will be 30 seconds.

The default value of this item: 0xF0 (hexadecimal). The wait time is set to 240s.

MaxUserPort setting (increase the maximum port connection):

Locate the HKEY_LOCAL_MACHINE\ SYSTEM\ CurrentControlSet\ Services\ TCPIP\ Parameters registry subkey

And create a new REG_DWORD value named MaxUserPort

Set this value to a decimal minimum of 32768

The wait time for this value will be 30 seconds.

Restart the windows system.

Default value for this item: 5000 (decimal)

Close Registry Editor and restart the windows system.

At this point, the study on "how to solve the mysql connection error code 10048" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report