No announcement yet.

Can't connect to MySQL server on 'localhost' (10048)

  • Filter
  • Time
  • Show
Clear All
new posts

  • Can't connect to MySQL server on 'localhost' (10048)


    I am getting these errors on the forum, but on the same server I am running MS SQL with over 100 sites connecting to it without a problem.

    Is there anything I can check?

    Database error in vBulletin:

    mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Can't connect to MySQL server on 'localhost' (10048)
    ....\forum\includes\class_core.php on line 273

    MySQL Error :
    Error Number :
    Date : Friday, November 24th 2006 @ 06:43:12 AM
    Script :
    Referrer :
    IP Address : 000
    Username :
    Classname : vB_Database

  • #2

    Did you just switch hosts? I'm not sure if the 10048 is a port number or if it's the error number. If it is the port number, and you used 10048 at your old host, 3306 is the DEFAULT MySQL port. It's in includes/config.php

    $config['MasterServer']['servername'] = 'localhost';
    $config['MasterServer']['port'] = 3306;

    If it says $config['MasterServer']['port'] = 10048; on the line, might want to change it to 3306.

    Hope this helped a tad.


    • #3
      The 10048 is the error no, not tcp port. mySQL running on standard port.
      The site is fully operational, just every now and again I get a whole batch of errors.


      • #4
        Originally posted by dfe View Post
        The 10048 is the error no, not tcp port. mySQL running on standard port.
        The site is fully operational, just every now and again I get a whole batch of errors.
        Seems like 10048 is a global error number.

        "A bind failure occurs when two gateways try to listen on the same network port. Check the gateway configuration files for a conflicting network service name or port number."

        So I don't know if that is clients spoofing IPs or if it's server side. If it happens once in awhile but you get a lot of error e-mails, maybe it's clients spoofing?

        Sorry if I'm not helping


        • #5
          Please see this page for the causes of this error:

          Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
          Change CKEditor Colors to Match Style (for 4.1.4 and above)

          Steve Machol Photography

          Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


          • #6
            It seems to be a Windows error, and not mySQL or VB.

            Herewith two documents dealing with it.


            When you're running a MySQL server on Windows with many TCP/IP connections to it, and you're experiencing that quite often your clients get a Can't connect to MySQL server error, the reason might be that Windows doesn't allow for enough ephemeral (short-lived) ports to serve those connections.
            By default, Windows allows 5000 ephemeral (short-lived) TCP ports to the user. After any port is closed it will remain in a TIME_WAIT status for 120 seconds. This status allows the connection to be reused at a much lower cost than reinitializing a brand new connection. However, the port will not be available again until this time expires.
            With a small stack of available TCP ports (5000) and a high number of TCP ports being open and closed over a short period of time along with the TIME_WAIT status you have a good chance for running out of ports. There are two ways to address this problem:
            • Reduce the number of TCP ports consumed quickly by investigating connection pooling or persistent connections where possible
            • Tune some settings in the Windows registry (see below) "
            Last edited by dfe; Mon 27 Nov '06, 9:55pm.


            widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.