473,320 Members | 1,719 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

mySQL connection limit

Hello,

Thought I read somewhere saying that there is a limit to how many
connections are available per mySQL account or something like that. Can
someone please clarify?

I wrote a PHP tool that uses a different PHP file whenever someone hit an
HTML form button (ie Submit). It turned out that each one of these PHP
files need to re-open the link to the mySQL database by the following
snippet or else that particular file won't work:

@ $link = mysql_connect("localhost", "myself", "");
if (!$link == 1)
echo "Connection to database failed.";

But I thought that PHP will use the already opened link from the previous
PHP file and as a result the above is not necessary. Is this true, or only
if it is within the same PHP file? And would having called the above code
snippet too many times cause mySQL to prevent user "myself" from connecting
again?

Thanks
Jul 17 '05 #1
1 8929
"Titus Cheung" <ti***@ieee.org> writes:
Thought I read somewhere saying that there is a limit to how many
connections are available per mySQL account or something like that. Can
someone please clarify?
Both PHP and MySQL have configuration settings that can limit a
user's database connections. See the documentation:

http://www.php.net/mysql
http://www.mysql.com/documentation/
I wrote a PHP tool that uses a different PHP file whenever someone hit an
HTML form button (ie Submit). It turned out that each one of these PHP
files need to re-open the link to the mySQL database by the following
snippet or else that particular file won't work:

@ $link = mysql_connect("localhost", "myself", "");
if (!$link == 1)
echo "Connection to database failed.";

But I thought that PHP will use the already opened link from the previous
phP file and as a result the above is not necessary.
Without a call to mysql_connect() or mysql_pconnect(), how would
PHP know which database you want to connect to? How would PHP know
which "previous" file's database connection to re-use?

You might be thinking of persistent connections, where you can use
a previously-established connection by calling mysql_pconnect().

http://www.php.net/features.persistent-connections
http://www.php.net/mysql_pconnect
Is this true, or only if it is within the same PHP file? And
would having called the above code snippet too many times cause
mySQL to prevent user "myself" from connecting again?


It's possible that repeated connections would eventually fail --
you'll have to check your PHP and MySQL configurations to see what
the limits are.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Mike Chirico | last post by:
Interesting Things to Know about MySQL Mike Chirico (mchirico@users.sourceforge.net) Copyright (GPU Free Documentation License) 2004 Last Updated: Mon Jun 7 10:37:28 EDT 2004 The latest...
2
by: Beda Christoph Hammerschmidt | last post by:
MySQL, Access, ODBC, Replication Hello, i have a central mysql database that is accesed by multiple clients running MS Access with ODBC. This works fine if Access has a permanent connection...
1
by: Good Man | last post by:
Hi there I've noticed some very weird things happening with my current MySQL setup on my XP Laptop, a development machine. For a while, I have been trying to get the MySQL cache to work....
15
by: Cheryl Langdon | last post by:
Hello everyone, This is my first attempt at getting help in this manner. Please forgive me if this is an inappropriate request. I suddenly find myself in urgent need of instruction on how to...
1
by: Sanny | last post by:
I am using a MySql database for chat application. Every 3 seconds the database is searched for various details. I would like to know How many individual can it handle at a time. Say there...
1
by: Ike | last post by:
Recently, I began using a different MySQL verver (i.e. different machine as well as different version#, going from 4.12a to 4.1.9 max). The following query used to work: select firstname,...
4
by: Federico | last post by:
Hi everybody, I'm evaluating the possibility of using MySQL 5.0 as a database backend for an application we are doing and I'd like to have hardware requirements rough estimates and/or real world...
6
Atli
by: Atli | last post by:
This is an easy to digest 12 step guide on basics of using MySQL. It's a great refresher for those who need it and it work's great for first time MySQL users. Anyone should be able to get...
10
by: Caffeneide | last post by:
I'm using a php script which performs three xml queries to other three servers to retrieve a set of ids and after I do a query to mysql of the kind SELECT * FROM table WHERE id IN ('set of ids');...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.