[PHP-DB] resolved : Re: [PHP-DB] too many connections?
i searched at mysql.com and it said basically what you are asking. i contacted the server admin and they are going to re-set the server. thank you for your time. best regards, addison Assuming that line 5 is the dbconnect, is there a limit on the number of connections that your MySQL server allows? Is there a limit set in php.ini? Shannon Johnston On Mon, 2003-01-27 at 15:13, Addison Ellis wrote: hello and thank you. any idea what this means? i have not touched or changed my config.php file since i put it up the first time... it contains my db connect info. also, i just downloaded it from the server to see if it had been modified and it had not. thanks again and best, addison Warning: Too many connections in /users/infoserv/web/register/ca/admin/config.php on line 5 Warning: MySQL Connection Failed: Too many connections in /users/infoserv/web/register/ca/admin/config.php on line 5 -- Shannon Johnston <[EMAIL PROTECTED]> -- Addison Ellis small independent publishing co. 114 B 29th Avenue North Nashville, TN 37203 (615) 321-1791 [EMAIL PROTECTED] [EMAIL PROTECTED] subsidiaries of small independent publishing co. [EMAIL PROTECTED] [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] too many connections?
> any idea what this means? i have not touched or changed my > config.php file since i put it up the first time... it contains my db > connect info. also, i just downloaded it from the server to see if it > had been modified and it had not. thanks again and best, addison > > Warning: Too many connections in > /users/infoserv/web/register/ca/admin/config.php on line 5 > > Warning: MySQL Connection Failed: Too many connections in > /users/infoserv/web/register/ca/admin/config.php on line 5 It's exactly what it say, there are too many connections to your MySQL server. By default, you can have 100 connections to a MySQL server. If you have a ton of traffic, you will need to increase that limit so that you don't get errors like this. If you don't have enough traffic to generate 100 connections at the same time, then run a SHOW PROCESSLIST on your MySQL server to see if you have a query locking things up and everything else is waiting (did this the other day, oops!) ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] too many connections?
What database are you using for your server? What OS is it running on? I've run into this on MSSQL before but never on MySql. =C= p.s. Hi from Antioch! * * Cal Evans * Stay plugged into your audience. * http://www.christianperformer.com * -Original Message- From: Addison Ellis [mailto:[EMAIL PROTECTED]] Sent: Monday, January 27, 2003 4:14 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] too many connections? hello and thank you. any idea what this means? i have not touched or changed my config.php file since i put it up the first time... it contains my db connect info. also, i just downloaded it from the server to see if it had been modified and it had not. thanks again and best, addison Warning: Too many connections in /users/infoserv/web/register/ca/admin/config.php on line 5 Warning: MySQL Connection Failed: Too many connections in /users/infoserv/web/register/ca/admin/config.php on line 5 -- Addison Ellis small independent publishing co. 114 B 29th Avenue North Nashville, TN 37203 (615) 321-1791 [EMAIL PROTECTED] [EMAIL PROTECTED] subsidiaries of small independent publishing co. [EMAIL PROTECTED] [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] too many connections?
This would make a whole lot more sense within a context...such as how busy is your application, what kind of connection you are using (pconnect vs. connect) and so on. A quick search on MySQL's web site resulted in: http://www.mysql.com/doc/en/Too_many_connections.html Be sure to check out general messages in the mailing list archives as well and Google. Good luck. Addison Ellis wrote: hello and thank you. any idea what this means? i have not touched or changed my config.php file since i put it up the first time... it contains my db connect info. also, i just downloaded it from the server to see if it had been modified and it had not. thanks again and best, addison Warning: Too many connections in /users/infoserv/web/register/ca/admin/config.php on line 5 Warning: MySQL Connection Failed: Too many connections in /users/infoserv/web/register/ca/admin/config.php on line 5 -- John Krewson Programmer - SWORPS -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] TOO MANY CONNECTIONS!!
You can also do something like this: if ($db_link = mysql_pconnect($host, $user, $pass)) { if (mysql_select_db($db,$db_link)) { return $db_link; } else die("MySQL Error: Cannot select {$db} database using {$user}@{$host}: ".mysql_error()); } else die("MySQL Error: Cannot connect to {$db}: ".mysql_error()); make $db_link global (if you use this in a function) then you can know that you are connected if your script is still running. If you make two connections, just make db_link something different for the other connection, and do this: $x = mysql_query("Select * from users",$db_link); That will force PHP to use the $db_link specified instead of the "last opened" connection. Peter On Fri, 25 Oct 2002, dr. Agon wrote: > Helo, > > why you don't make some kind of "db_connect.php" which will make "mysql_pconnect()" >and include it in top of your first script? You then will be able use mysql query in >everyone of your page. You can also make $mysql_is_connected=true; there and check >that variable in other scrips if need to be sure that this file was already included. > > -- > Regards, A.K. > > "Georgie Casey" <[EMAIL PROTECTED]> wrote in message >news:20021024201835.36082.qmail@;pb1.pair.com... > > Yeah, sometimes I open and close 2 or 3 permanent connections in one page. I > > knida have to as each page is made up of a few different include files, and > > if I dont do seperate connections, it mightnt work. > > > > I'll recode my site to cache everything except search pages, or can I even > > cache these as well?? > > "Duncan Hill" <[EMAIL PROTECTED]> wrote in message > > news:20021023222841.GD30375@;bajan.cricalix.net... > > > On Wed, Oct 23, 2002 at 10:18:07PM +0100, Georgie Casey wrote: > > > > Im getting a too many connections error in my PHP pages at > > > > http://www.free-ringtones.tv. I presume this is from the MySQL server, > > and I > > > > know I access the database a lot for each page. So whats the solution to > > > > > > MySQL has a default of either 50 or 100 concurrent connections. Exceed it > > > and you'll get that error. That parameter is configurable - if you run > > the > > > MySQL daemon itself. If you use shared hosting, you may not be able to > > > tweak it. > > > > > > Do the pages -need- to be totally dynamic, or can you use the caching > > system > > > you mentioned? If so, then wrap code that stats an HTML page for the > > time, > > > and if it's too old, update it. Be sure to use file locking so you don't > > > clobber yourself. > > > > > > Moreover, do you open one connection and re-use it in a page, or do you do > > > multiple opens and closes? > > > > > > > > -- > > PHP Database Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > --- Peter BeckmanSystems Engineer, Fairfax Cable Access Corporation [EMAIL PROTECTED] http://www.purplecow.com/ --- -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] TOO MANY CONNECTIONS!!
Helo, why you don't make some kind of "db_connect.php" which will make "mysql_pconnect()" and include it in top of your first script? You then will be able use mysql query in everyone of your page. You can also make $mysql_is_connected=true; there and check that variable in other scrips if need to be sure that this file was already included. -- Regards, A.K. "Georgie Casey" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Yeah, sometimes I open and close 2 or 3 permanent connections in one page. I > knida have to as each page is made up of a few different include files, and > if I dont do seperate connections, it mightnt work. > > I'll recode my site to cache everything except search pages, or can I even > cache these as well?? > "Duncan Hill" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > On Wed, Oct 23, 2002 at 10:18:07PM +0100, Georgie Casey wrote: > > > Im getting a too many connections error in my PHP pages at > > > http://www.free-ringtones.tv. I presume this is from the MySQL server, > and I > > > know I access the database a lot for each page. So whats the solution to > > > > MySQL has a default of either 50 or 100 concurrent connections. Exceed it > > and you'll get that error. That parameter is configurable - if you run > the > > MySQL daemon itself. If you use shared hosting, you may not be able to > > tweak it. > > > > Do the pages -need- to be totally dynamic, or can you use the caching > system > > you mentioned? If so, then wrap code that stats an HTML page for the > time, > > and if it's too old, update it. Be sure to use file locking so you don't > > clobber yourself. > > > > Moreover, do you open one connection and re-use it in a page, or do you do > > multiple opens and closes? > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
Re: [PHP-DB] TOO MANY CONNECTIONS!!
Just open one connection. It'll work fine for multiple queries across several include files. I have a project right now that uses about 5 different include files at any one time, and 1 connection works great. Also keeping only one connection alive will speed up the script. -Micah At 09:14 PM 10/24/2002 +0100, Georgie Casey wrote: Yeah, sometimes I open and close 2 or 3 permanent connections in one page. I knida have to as each page is made up of a few different include files, and if I dont do seperate connections, it mightnt work. I'll recode my site to cache everything except search pages, or can I even cache these as well?? "Duncan Hill" <[EMAIL PROTECTED]> wrote in message news:20021023222841.GD30375@;bajan.cricalix.net... > On Wed, Oct 23, 2002 at 10:18:07PM +0100, Georgie Casey wrote: > > Im getting a too many connections error in my PHP pages at > > http://www.free-ringtones.tv. I presume this is from the MySQL server, and I > > know I access the database a lot for each page. So whats the solution to > > MySQL has a default of either 50 or 100 concurrent connections. Exceed it > and you'll get that error. That parameter is configurable - if you run the > MySQL daemon itself. If you use shared hosting, you may not be able to > tweak it. > > Do the pages -need- to be totally dynamic, or can you use the caching system > you mentioned? If so, then wrap code that stats an HTML page for the time, > and if it's too old, update it. Be sure to use file locking so you don't > clobber yourself. > > Moreover, do you open one connection and re-use it in a page, or do you do > multiple opens and closes? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] TOO MANY CONNECTIONS!!
Yeah, sometimes I open and close 2 or 3 permanent connections in one page. I knida have to as each page is made up of a few different include files, and if I dont do seperate connections, it mightnt work. I'll recode my site to cache everything except search pages, or can I even cache these as well?? "Duncan Hill" <[EMAIL PROTECTED]> wrote in message news:20021023222841.GD30375@;bajan.cricalix.net... > On Wed, Oct 23, 2002 at 10:18:07PM +0100, Georgie Casey wrote: > > Im getting a too many connections error in my PHP pages at > > http://www.free-ringtones.tv. I presume this is from the MySQL server, and I > > know I access the database a lot for each page. So whats the solution to > > MySQL has a default of either 50 or 100 concurrent connections. Exceed it > and you'll get that error. That parameter is configurable - if you run the > MySQL daemon itself. If you use shared hosting, you may not be able to > tweak it. > > Do the pages -need- to be totally dynamic, or can you use the caching system > you mentioned? If so, then wrap code that stats an HTML page for the time, > and if it's too old, update it. Be sure to use file locking so you don't > clobber yourself. > > Moreover, do you open one connection and re-use it in a page, or do you do > multiple opens and closes? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] TOO MANY CONNECTIONS!!
On Wed, Oct 23, 2002 at 10:18:07PM +0100, Georgie Casey wrote: > Im getting a too many connections error in my PHP pages at > http://www.free-ringtones.tv. I presume this is from the MySQL server, and I > know I access the database a lot for each page. So whats the solution to MySQL has a default of either 50 or 100 concurrent connections. Exceed it and you'll get that error. That parameter is configurable - if you run the MySQL daemon itself. If you use shared hosting, you may not be able to tweak it. Do the pages -need- to be totally dynamic, or can you use the caching system you mentioned? If so, then wrap code that stats an HTML page for the time, and if it's too old, update it. Be sure to use file locking so you don't clobber yourself. Moreover, do you open one connection and re-use it in a page, or do you do multiple opens and closes? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] TOO MANY CONNECTIONS!!
Send me the code around the lines that are giving errors.. Doesn't look like a MySQL error to me. -Micah At 10:18 PM 10/23/2002 +0100, Georgie Casey wrote: Im getting a too many connections error in my PHP pages at http://www.free-ringtones.tv. I presume this is from the MySQL server, and I know I access the database a lot for each page. So whats the solution to this?? Write scripts that create static html pages that update every 20 minutes or so?? And was it the host that limited my connections??? TIA -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php