mysql error 10048 - how do we solve it

nabil_zakkak
nabil_zakkak used Ask the Experts™
on
mysql 10048 , how do we solve that error . what is the cause of this error
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
Hi,

I have found this in expert exchange.

http://www.experts-exchange.com/Database/MySQL/Q_23215173.html
theGhost_k8Database Consultant

Commented:
You'r trying to access you mysql server from network and there may be some entries to my.cnf for restricting remote access.
check mysql for :
1) skip-networking
2) bind-address=127.0.0.1
If any of that/they'r there remove//comment it. And restart mysql.

May be firewall is stopping you to connect.

Author

Commented:
The problem is nothign to do with the server or mysql the problem when I have too many load on the database the database will refuse connection for 1 or 2 minutes and then will accept the connections. So the main problem is when the server is busy.  Any suggestion
Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

Found this on the net, it seems to offer a solution to the issue.:

"The error is caused not by MySQL or the MySQL ODBC driver, but by the behaviour of Windows. For performance reasons Windows maintains a connection on a TCP port after it is closed for (by default) 4 minutes. The advantage of this is that if the connection needs to be reopened it can be done at a lower cost. The trouble is that under heavy load when lots of connections are opened and closed to the database, the system can hit a limit on the maximum number of connections allowed (even though as far as the application is concerned these connections have been closed).

 In theory enabling connection pooling would address this problem. For more information about connection pooling see  http://support.microsoft.com/default.aspx?scid=kb;EN-US;q169470. To enable connection pooling for the MySQL driver:"

   1. Start > Control Panel > Administrative Tools > Data Sources (ODBC).
      This will open up the "ODBC Data Source Administrator".
   2. On the "Connection Pooling" tab, double click the ODBC Driver you are using to connect to MySQL.
      This will open up the "Set Connection Pooling Attributes" dialog.
   3. To enable pooling select "Pool Connections to this driver"

The full article can be found here:
http://www.cryer.co.uk/brian/mysql/trouble_odbc_cant_connect_on_localhost.htm

Author

Commented:
But I am not using odbc driver to connect to mysql. I am using php command "mysql_connect ".  Any suggestion
theGhost_k8Database Consultant

Commented:
If you want to increase number of connection allowed by mysql, in configuration file chenge
value of following parameter:-
max_connections = 250
We get this issue and i'm pretty sure we have mysql set to unlimited connections.

Author

Commented:
no mysql max_connections=500

Author

Commented:
I am still waiting for an answer

Author

Commented:
the problem of mysql doesn't solved yet.  Pls assist
We still haven't managed to resolve this one either. We're leaning towards it actually being a Windows issue in our case. We have 1 db, with 2 windows servers accessing it, but on occassion, one or the other is unable to access it. The DB is still there and running fine it appears, but something still is rejecting the connections.

Author

Commented:
what I have to do

Author

Commented:
I did get a solution

Author

Commented:
I did get a solution

Author

Commented:
I did get a solution

Author

Commented:
I didn't get a solution
We found the problem to be a windows issue. We resolved it by changing the maxuserports registry setting.

It's documented in the mysql docs and worked like a charm for us on Windows 2003 Server. Ps. you do it on the client machine if you have a seperate client / server.:

http://dev.mysql.com/doc/refman/5.0/en/can-not-connect-to-server.html


                 Start Registry Editor                 (Regedt32.exe).              
 
                 Locate the following key in the registry:                HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
 
 On the Edit menu, click Add                 Value, and then add the following registry                 value:                Value Name: MaxUserPort
Data Type: REG_DWORD
Value: 65534
 
                 This sets the number of ephemeral ports available to any                 user. The valid range is between 5000 and 65534                 (decimal). The default value is 0x1388 (5000 decimal).                
 
                 On the Edit menu, click Add                 Value, and then add the following registry                 value:                Value Name: TcpTimedWaitDelay
Data Type: REG_DWORD
Value: 30
 
                 This sets the number of seconds to hold a TCP port                 connection in TIME_WAIT state before                 closing. The valid range is between 0 (zero) and 300                 (decimal). The default value is 0x78 (120 decimal).                

                 Quit Registry Editor.              

                 Reboot the machine.              

Author

Commented:
thank you very much i have been looking for this answer since 09.26.2008 . I made my life terrible.  I lost my client because of that.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial