I'm developing a system in PHP5 with the new mysqli extension. After a while of developing I got an error saying MySQL had too many connections - I checked and they were all in the status of 'Sleep'. I restarted the MySQL server and added code into my script to close the DB connections (good practice anyways I know, but technically PHP should close connection at the end of the script execution). The same problem with too many connections still occurs.
Is this something to do with mysqli or PHP5 or... ?
Help me please! It's driving me nuts!
Simon PlenderleithJust out of curiosity, why do you need to use the Improved mysql client libraries instead of the normal ones?Have you tried any of the suggestions for MySQL and PHP4 that have been made in these forums before?Originally posted by goldbug
Just out of curiosity, why do you need to use the Improved mysql client libraries instead of the normal ones?
The mySQLi extension is made to access mySQL 4.1 and higher. The regular mySQL extenstion is for anything below that. Quotes from php.net
mySQLi
The mysqli extension allows you to access the functionality provided by MySQL 4.1 and above.
mySQL
This MySQL extension doesn't support full functionality of MySQL versions greater than 4.1.0. For that, use MySQLi.Partially true.
You can still use the regular (and arguably more stable) mysql extensions with higher versions. I personally build PHP5 against MySQL 5.0a on one of my boxes and it doesn't complain.
One thing you might want to keep in mind though... on the very same pages of the manual (yes, I have already read it, but thanks for quoting it anyway ), it also states that the MySQLi extension is experimental. Usually when I see words like that, I don't expect stuff to work perfectly.
Is this something to do with mysqli or PHP5 or... ?
Help me please! It's driving me nuts!
Simon PlenderleithJust out of curiosity, why do you need to use the Improved mysql client libraries instead of the normal ones?Have you tried any of the suggestions for MySQL and PHP4 that have been made in these forums before?Originally posted by goldbug
Just out of curiosity, why do you need to use the Improved mysql client libraries instead of the normal ones?
The mySQLi extension is made to access mySQL 4.1 and higher. The regular mySQL extenstion is for anything below that. Quotes from php.net
mySQLi
The mysqli extension allows you to access the functionality provided by MySQL 4.1 and above.
mySQL
This MySQL extension doesn't support full functionality of MySQL versions greater than 4.1.0. For that, use MySQLi.Partially true.
You can still use the regular (and arguably more stable) mysql extensions with higher versions. I personally build PHP5 against MySQL 5.0a on one of my boxes and it doesn't complain.
One thing you might want to keep in mind though... on the very same pages of the manual (yes, I have already read it, but thanks for quoting it anyway ), it also states that the MySQLi extension is experimental. Usually when I see words like that, I don't expect stuff to work perfectly.