Resolve can ' t connect to MySQL server on ' localhost ' (10048)

Source: Internet
Author: User
Tags mysql manual mysql version

Resolve can ' t connect to MySQL server on ' localhost ' (10048)

You are using the Windows operating system, and this error is related to a registry key value of TcpTimedWaitDelay.
Reducing tcptimedwaitdelay time in Windows resolves such problems, which by default is 240 (this is also the case if not set)
This setting needs to be set to the registry in the following location
Hkey_local_machine/system/currentcontrolset/services/tcpip/parameters/tcptimedwaitdelay
If this item is not tcptimedwaitdelay in the registry, increase this item and set it to double-byte (DWORD) type
The value is set between 30 ~ 60

Reprint statement: This article transferred from http://www.devdao.com/Article/384352.htm

====================================================================

Resolve can ' t connect to MySQL server on ' localhost ' (10048)

Original source: http://www.hao32.com/webserver/55.html
Solve can ' t connect to MySQL server on ' localhost ' (10048), commonly seen in Windows 2003 servers using MySQL.

Reason for the occurrence of the error:

The application needs to quickly release and create new connections, but lower throughput due to the presence of connections in time_wait that exceed the default values.

Solution:
Two windows registry entries that are closely related to this error: TcpTimedWaitDelay and MaxUserPort values.

TcpTimedWaitDelay determines the time that TCP/IP must pass before it can release a closed connection and reuse its resources. This interval between closing and releasing is known as the time_wait state or twice times the maximum segment life cycle (2MSL) state. During this time, reopening the connection to the client and the server costs less than establishing a new connection. Reducing this value allows TCP/IP to release closed connections more quickly, providing more resources for new connections.

MaxUserPort determines the maximum number of ports that TCP/IP can specify when requesting any available user ports from the system. If you establish a TCP connection with a maximum port connection greater than 5000, the local computer responds with the following error message Wsaenobufs (10055): Because the system lacks sufficient buffers or because the queue is full, the socket operation cannot be performed, resulting in an application 10048 error.

Open Registry Editor regedit

TcpTimedWaitDelay settings:
Locate the Hkey_local_machine/system/currentcontrolset/services/tcpip/parameters registry sub-key
and create a new REG_DWORD value named TcpTimedWaitDelay
Set this value to decimal 30, hexadecimal to 0x0000001e
The value wait time will be 30 seconds.
Default value for this item: 0xF0 (16 binary), wait time set to 240 seconds

MaxUserPort settings (Increase maximum port connection):
Locate the Hkey_local_machine/system/currentcontrolset/services/tcpip/parameters registry sub-key
and create a new REG_DWORD value named MaxUserPort
Set this value to the decimal minimum of 32768
The value wait time will be 30 seconds.
Restart the Windows system.
Default value for this entry: 5000 (decimal)

Close Registry Editor and restart your Windows system.

Reprint statement: This article transferred from http://www.ismole.net/thread-997-1-1.html

====================================================================

Mysql 10048,10055 Error Detailed workaround summary


Recently the server database collapsed, depressed, found a lot of methods, also did not solve. Roll over these methods.
After the server has been open for some time, MySQL automatically hangs up ~ does not want to restart to solve the problem, suggest novice or with MYSQL4. X version, 5 is really not perfect. In addition, this kind of problem can not be solved by a simple method. Hope that other people who have this problem can be inspired ~ ~ ~
Description 1:
Server configuration: Win2003, serv-u6.0, mysql-4.0.24, php-4.3.11, sql2000
After the server has been running for some time, the PHP Web site does not open, prompting the can ' t connect to MySQL server on ' localhost ' (10055) error. Restarting the MySQL service has no effect and only restarts the server. But after a few days, this error occurs again.

My My.ini configuration content:
#This File was made using the Winmysqladmin 1.4 Tool
#2005-6-26 16:53:57

#Uncomment or ADD only the keys, that's know how works.
#Read the MySQL Manual for instructions

[Mysqld]
Basedir=c:/mysql
#bind-address=192.168.13.81
Datadir=c:/mysql/data
#language =c:/mysql/share/your Language Directory
#slow Query log#=
#tmpdir #=
#port =3306
#set-variable=key_buffer=16m
[Winmysqladmin]
Server=c:/mysql/bin/mysqld-nt.exe
User=root
password=%%%
--------------------------------------------------------------------------------

Description Two:
Can ' t connect to MySQL server on ' localhost ' (10055) (2003)
Can ' t connect to MySQL server on ' localhost ' (10048) (2003)

My system is 2003, my MySQL for a period of time will repeatedly appear above the error .... Reboot is good, but after a while the problem comes again ... Related Research direction

Description Three:
My MySQL has always been wrong, prompting ' localhost ' (10055) Error! Look at the log, this is the prompt:
--------------------------------------------------------------------------------
Mysql:ready for connections
Mysql:ready for connections
Cannot initialize InnoDB as ' Innodb_data_file_path ' is not set.
If you don't want to use transactional InnoDB tables, add a line
Skip-innodb
To the [mysqld] sections of init parameters in your MY.CNF
or My.ini. If you want-InnoDB tables, add to the [mysqld]
section, for example,
Innodb_data_file_path = Ibdata1:10m:autoextend
But to get good performance-should adjust for your hardware
The InnoDB startup options listed in sections 2 at
Http://www.innodb.com/ibman.html
050621 13:25:20 mysql:normal shutdown
050621 13:25:20 Mysql:shutdown Complete
Mysql:ready for connections
--------------------------------------------------------------------------------
What do you mean, please? And after each error, you have to restart the machine to be good. If you just restart the MySQL service, it won't work.

Workaround Reference (online)
One:
I think it may be the landlord of some of the program write a problem, may occupy the connection and not disconnected. In addition, the landlord's MySQL server is not installed a firewall? In particular, Norton Firewall, I have encountered, obviously allow my IP access to the protected server, but after a period of time, I think that my IP is illegal attack, automatically give me IP sealed, or wait 20 minutes (the default rule), or the new boot server is good ....

Second: This article uses caution, after I change, the view always appears the server internal error
You are using the Windows operating system, and this error is related to a registry key value of TcpTimedWaitDelay. Reducing tcptimedwaitdelay time in Windows resolves such problems, which by default is 240 (this is also the case if not set). This setting needs to be set to the following location in the registry: Hkey_local_machinesystemcurrentcontrolsetservicestcpipparameterstcptimedwaitdelay
If the registry does not tcptimedwaitdelay this item, increase this item and set it to double-byte (DWORD) type. The value is set between 30 and 60.

Three:
Server FTP test completed, restarted a bit. Everything is stable. But there are still a few questions that are not clear. Heart is not assured.

1. In the Friday, when the FTP pressure is not large, 30 minutes online statistics of more than 900 people, 10% of the ratio of MySQL connection failed the 10048 error.
2. The connection method I was using was mysql_connect (). How the server Iis+php+isapi. After referencing some information, I immediately changed the Mysql_connect () method to the Mysql_pconnect () method, when the problem seemed to be solved.
3. In Saturday, the server started the FTP stress test. The 15% ratio has 10048 10055 errors with MySQL connection failure. A 10055 more error than the last time.

The key does not know the 10048 10055 error code specifically represents the error message. It should be said that the question still did not find the exact answer.

I opened the serv-u, there are 4 sockets connected, MySQL immediately hang the Data Mining Research Institute

Four:
Can ' t connect to MySQL server on ' localhost ' (10048)
Can ' t connect to MySQL server on ' localhost ' (10055)
MySQL version 4.0.13-nt

Server: Windows2000 server + iis5.0 + PHP ISAPI + MySQL

I developed a Web site with Php+mysql, which has a high level of access.
But after one weeks of normal operation, the can ' t connect to MySQL server on ' localhost ' (10048) error began to occur frequently.

The statistical data are as follows:
Attempt failed number of links 10,594
Total number of links per hour 885.37
% 15.91%

As you can see, the ratio of connection failures is very high. It should be emphasized that a week ago, the same number of links did not appear so high error rate.

Cause analysis: Use the FPort tool to view, you will find someone is running out of your database connection. And it is clear that they are characterized by dozens of connections from the same IP and are TIME-WAITK

Solution:1. It is recommended to modify the maximum number of connections, or to change the mysql_connect () method to the Mysql_pconnect () method,
2. Symptoms, block these IPs, an IP connection greater than 3 is a bit abnormal, sealed
3. Fix the root, modify the site program, strictly forbid to refresh too fast!
Additional instructions: You can block the external connection to the local 3306 port directly in the firewall!

Reprint statement: This article transferred from http://bbs.bokecc.com/viewthread.php?tid=76307

====================================================================

Resolve can ' t connect to MySQL server on ' localhost ' (10048)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.