Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4007932
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T08:41:30+00:00 2026-05-20T08:41:30+00:00

We are seeing a MySQL connection problem on our server. The strange thing is

  • 0

We are seeing a MySQL connection problem on our server. The strange thing is that this problem only occurs once in a while, perhaps 1 out of 100 times, and it seems it happens more frequently when there is heavy load on our servers. Before, when we had much less users, we would never see this error.

The error comes from this line of code:

$myconnection = mysql_pconnect($hostname_myconnection, $username_myconnection, $password_myconnection) or trigger_error(mysql_error(),E_USER_ERROR);

and the error which is thrown is:

Warning: mysql_pconnect() [function.mysql-pconnect]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (11) in/home/john/web/htdocs/lib/myconnection.php on line 11

In the same file we also establish another MySQL connection,
which is based on Zend Db Adapter:

$db = new Zend_Db_Adapter_Mysqli($data);

We use both the two connections.

My question is: where does this error come from? Can the error be triggered because too many people are trying to establish a connection at the same time? If this is the case, what is the setting in httpd.conf or my.cnf that we should change? Or is it a problem that we are establishing two connections per user?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T08:41:31+00:00Added an answer on May 20, 2026 at 8:41 am

    I see you’re using persistent connections so this should not be a problem at all. I suspect your PHP was not compiled with persistent connections, and mysql_connect is called in the background instead of its persistent cousin.

    All systems have a limit on open sockets and files, if you are instantiating many connections during page load and the persistent function is not working they each take up a new socket.

    You should also consider closing the connections manually, as PHP scripts can run a few seconds even after the client hit the cancel button, and cleanup (closing the connection) could take a while this way.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using only MySQL , I'm seeing if it's possible run an insert statement ONLY
I'm seeing some errors that would indicate a connection leak. That is, connections that
I am using a mySql DECIMAL(12,4) column to hold price values (seeing how that's
Seeing this: http://www.suckless.org/wiki.html . A wiki based on Mercurial. Are there any other non-code
I'm seeing strange errors when my C++ code has min() or max() calls. I'm
This should be fine seeing as the CLR hasn't actually changed? The boxes running
I am using MySQL 5.0 for a site that is hosted by GoDaddy (linux).
I've asked this question before, here , however that solution didn't fix it when
I've got a problem with ODBC that has me stumped, and I can't find
I installed php and mysql on a Windows 2003 server running IIS6. I uncommented

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.