Jump to content

MySQL Connections


SharkBait

Recommended Posts

Hi,

 

  Looking for advice when it comes to connections with MySQL. Currently I go the easy way and use

mysql_connect()

but I noticed that one of my windows apps has an issue with closing connections and I kept getting error about there were no connections available.

 

Now I can look through the code and fix that, but is it better to use persistant connections?  I have more web based apps that use MySQL and is it more efficient to to use mysql_pconnect() and leave the connection open?

 

Currently all my scripts call mysql_connect() at the top and mysql_close() at the bottom.  I have 3 databases that multiple sites and 3 winapps use to read/write data too.

 

I could change the my.cnf file to allow more connections but that's more of a bandaid fix isnt it? My web queries are all under 0.5 secs when executed.  The server is a dual xeon setup running on a gigabit backbone (all web apps and win aps are run within our network).

 

So yea, just looking on advice.  Yes I'll be fixing that winApp that doesn't seem to properly close its MySQL Connections ;)

 

Thanks

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.