List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:September 23 1999 8:00pm
Subject:connection prb : perl + DBI + MyODBC + MySQL
View as plain text  
>>>>> "Philippe" == Philippe PETIT <annonceur@stripped>
> writes:

Philippe> hello,
Philippe> I have this error from time to time with 50 000 connections on database per
Philippe> day

Philippe> [TCX][MyODBC]Can't connect to MySQL server on localhost (10048)
Philippe> (SQL-S1000)(DBD: db_login/SQLConnect err=-1),

Philippe> my config :

Philippe> PII 350 128Mo RAM  DD 4Go SCSI
Philippe> Windows NT 4 SP3
Philippe> IIS 4
Philippe> MySQL 3.22.21
Philippe> service : mysqld-nt
Philippe> MyODBC 2.50.2100
Philippe> perl 5.00402 + DBI

Philippe> I have 10 Tables with 5000 at 10 000 records

Philippe> My.cnf :

Philippe> [client]
Philippe> #password=my_password
Philippe> port=3306
Philippe> #socket=MySQL

Philippe> # Here is entries for some specific programs
Philippe> # The following values assume you have at least 32M ram

Philippe> # The MySQL server
Philippe> [mysqld]
Philippe> port=3306
Philippe> #socket=MySQL
Philippe> skip-locking
Philippe> set-variable = key_buffer=32M
Philippe> set-variable = max_allowed_packet=2M
Philippe> set-variable = thread_stack=256K
Philippe> set-variable = flush_time=1800

Philippe> # Uncomment the following row if you move the MySQL distribution to another
Philippe> # location
Philippe> #basedir = d:/mysql/

Philippe> [mysqldump]
Philippe> quick
Philippe> set-variable = max_allowed_packet=32M

Philippe> [mysql]
Philippe> no-auto-rehash

Philippe> [isamchk]
Philippe> set-variable= key=32M

Philippe> do you have an idea ?

Philippe> thank in avance


According to Microsofts manual:

Address already in use. 

Only one usage of each socket address (protocol/IP address/port) is
normally permitted. This error occurs if an application attempts to
bind a socket to an IP address/port that has already been used for an
existing socket, or a socket that wasn't closed properly, or one that
is still in the process of closing. For server applications that need
to bind multiple sockets to the same port number, consider using
setsockopt(SO_REUSEADDR). Client applications usually need not call
bind at all - connect will choose an unused port automatically. When
bind is called with a wild-card address (involving ADDR_ANY), a
WSAEADDRINUSE error could be delayed until the specific address is
"committed." This could happen with a call to other function later,
including connect, listen, WSAConnect or WSAJoinLeaf.

My guess is that NT get problems if you do connect/close on a TCP/IP
connection too fast.

Some suggestions:

Can't you change your application to use persistent connections?

Try connecting to hostname '.' instead of localhost.  This will use
named pipes on NT instead of TCP/IP and may help in this case.


connection prb : perl + DBI + MyODBC + MySQLPhilippe PETIT23 Sep
  • Re: connection prb : perl + DBI + MyODBC + MySQLsasha23 Sep
  • connection prb : perl + DBI + MyODBC + MySQLMichael Widenius24 Sep
  • Re: connection prb : perl + DBI + MyODBC + MySQLPhilippe PETIT24 Sep