No announcement yet.

Why mysql_pconnect disabled on servers?

  • Filter
  • Time
  • Show
Clear All
new posts

  • Why mysql_pconnect disabled on servers?

    On all shared server mysql_pconnect is disabled by default. We can use mysql_connect instead of mysql_pconnect in database connection string configuration file. Mysql_pconnect open persistent connection to the database. Basically mysql_pconnect first check persistent links open with the server with same host, database username and password and if any existing connection is found, an identifier for it will be returned instead of opening a new connection to mysql server. The connection to the mysql server will not be closed or terminated when execution of the script completed. Connection will be open until we restart the Mysql server. Mysql_pconnect is useful for Heavy Traffic sites where resources burn up by opening and closing connections every time and few sites/database hosted on server. On shared server environment mysql_pconnect function will cause "Too many connections" error message as on shared server we have to restrict mysql users connection to mysql server to maintain server performance.

    Note : If any client having problem by using mysql_pconnect and they want to switch from mysql_pconnect to mysql_connect then please contact us on live chat support or send an E-mail at support [@]