473,480 Members | 2,277 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

php and mysql

I am trying to connect remotely to a mysql database.

here is the code:

<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_myDB = "http://db195.perfora.net";
$database_myDB = "dbname";
$username_myDB = "username";
$password_myDB = "password";
$myDB = mysql_pconnect($hostname_myDB, $username_myDB, $password_myDB)
or trigger_error(mysql_error(),E_USER_ERROR);
?>


here is the error:

Warning: mysql_pconnect(): Unknown MySQL Server Host 'db195.perfora.net'
(1) in /oldhome/WWW/wingsofthedawn.org/htdocs/final/Connections/myDB.php
on line 9
Jul 17 '05 #1
5 4349
On Wed, 04 May 2005 14:58:36 -0700, Kenneth <ja********@hotmail.com> wrote:
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_myDB = "http://db195.perfora.net";
MySQL over HTTP? That's a new one on me. HTTP is a protocol, it wants a
hostname. Remove the http:// , unless there's some wacky new protocol tunneling
thing that's been added to MySQL that I'm not aware of.
$database_myDB = "dbname";
$username_myDB = "username";
$password_myDB = "password";
$myDB = mysql_pconnect($hostname_myDB, $username_myDB, $password_myDB)
or trigger_error(mysql_error(),E_USER_ERROR);
?>

here is the error:

Warning: mysql_pconnect(): Unknown MySQL Server Host 'db195.perfora.net'
(1) in /oldhome/WWW/wingsofthedawn.org/htdocs/final/Connections/myDB.php
on line 9


--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #2
Kenneth <ja********@hotmail.com> wrote:
I am trying to connect remotely to a mysql database.

here is the code:

<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_myDB = "http://db195.perfora.net";
$database_myDB = "dbname";
$username_myDB = "username";
$password_myDB = "password";
$myDB = mysql_pconnect($hostname_myDB, $username_myDB, $password_myDB)
or trigger_error(mysql_error(),E_USER_ERROR);
?>
here is the error:

Warning: mysql_pconnect(): Unknown MySQL Server Host 'db195.perfora.net'
(1) in /oldhome/WWW/wingsofthedawn.org/htdocs/final/Connections/myDB.php
on line 9


The error seems pretty self-explanatory to me. db195.perfora.net does not
exist. I can see that from here.

Perfora.net DOES exist. What makes you think db195.perfora.net should be
valid?
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Jul 17 '05 #3
*** Andy Hassall wrote/escribió (Wed, 04 May 2005 20:19:52 +0100):
MySQL over HTTP? That's a new one on me. HTTP is a protocol, it wants a
hostname. Remove the http:// , unless there's some wacky new protocol tunneling
thing that's been added to MySQL that I'm not aware of.


SQLyog (a GUI client for Windows) has a HTTP tunneling system for MySQL
(written in PHP, by the way) but of course mysql_pconnect() doesn't know
how to handle it. I bet it's just a typo.

BTW, in my experience mysql_pconnect() is the way to kill the database
server: I used to get the max connections limit error when I had two
visitors and 98 idle open connections. I'd suggest mysql_connect() instead.

--
-- Álvaro G. Vicario - Burgos, Spain
-- http://bits.demogracia.com - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group
--
Jul 17 '05 #4
On Thu, 5 May 2005 13:37:55 +0200, Alvaro G Vicario
<al******************@telecomputeronline.com> wrote:
BTW, in my experience mysql_pconnect() is the way to kill the database
server: I used to get the max connections limit error when I had two
visitors and 98 idle open connections. I'd suggest mysql_connect() instead.


It depends on your configuration (e.g. number of child processes from
webserver) and number of distinct credentials used to access the database. If
your config/usage pattern doesn't match up then persistent connections in
general can easily knacker the database as you point out.

I've always thought that PHP's persistent connection system should have a
timeout where it closes connections after a while, it could piggy-back onto
requests the same way as the sessions garbage collector. It seems the only way
to do this is through your database config (if the database offers an "idle
timeout" option), or through your webserver config (e.g. MaxRequests on Apache
child processes). Seems to me it would be neater to have PHP manage its own
connection pools a bit more intelligently instead of having to configure other
tools further down the chain (which may have impact on things _other_ than PHP
that are using them).

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #5
>>BTW, in my experience mysql_pconnect() is the way to kill the database
server: I used to get the max connections limit error when I had two
visitors and 98 idle open connections. I'd suggest mysql_connect() instead.

It depends on your configuration (e.g. number of child processes from
webserver) and number of distinct credentials used to access the database. If
your config/usage pattern doesn't match up then persistent connections in
general can easily knacker the database as you point out.


I definitely agree.
I have a dedicated box that is running 50 websites all on one database
using p_connect. Some of the sites get a pretty intense load, but
though the caching of pages and queries there hasn't been even one
problem with a db connection yet.

Mike
Jul 17 '05 #6

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

Similar topics

2
10254
by: francescomoi | last post by:
Hi. I'm trying to build 'MySQL-python-1.2.0' on my Linux FC2: ---------------------------------- # export PATH=$PATH:/usr/local/mysql/bin/ # export mysqlclient=mysqlclient_r # python setup.py...
4
1305
by: mikey | last post by:
Hi all, I'm having great problems trying to install the latest MySQl RPM package onto my Red Hat Linux OS. There is already MySQL v 3.0 pre-installed with the RH Linux distribution disk but I...
0
1471
by: Yun Guan | last post by:
Hello mysql gurus, I am trying to run perl on mysql database on Red Hat box. I want to install DBI and DBD:mysql using CPAN: perl -MCPAN -e shell cpan>install DBI The above succeeded, but...
0
3919
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
2337
by: Saqib Ali | last post by:
I installed mySQL and have it running.... but I think I made a mistake somewhere along the line...... I believe I did follow the instructions that were provided with the distribution at:...
1
3798
by: Alex Hunsley | last post by:
I am trying to install the DBD::mysql perl module. However, it claims I need mysql.h: cpan> install DBD::mysql CPAN: Storable loaded ok Going to read /home/alex/.cpan/Metadata Database was...
0
1858
by: ./Rob & | last post by:
Hi gang: I'm experiencing a problem with MySQL -- I updated MySQL from version 4.1.0 to 4.1.10 and now when I login as root it doesn't show all the databases I should have access to, nor it...
2
2887
by: trihanhcie | last post by:
I m currently working on a Unix server with a fedora 3 as an os My current version of mysql is 3.23.58. I'd like to upgrade the version to 5.0.18. After downloading from MYSQL.COM the package on...
1
3190
by: manish deshpande | last post by:
Hi, When i'm installing MySQL-server-standard-5.0.24a-0.rhel3.i386.rpm by the following command: rpm -i MySQL-server-standard-5.0.24a-0.rhel3.i386.rpm the following error is being shown: ...
3
8786
by: menzies | last post by:
Hi, I"m new to this forum, but I have been trying all day to install DBD::mysql onto my Intel MacBook. I've read lots of forums pages and none have gotten me to a successful 'make test' or a...
0
7048
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7091
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
6966
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4787
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4488
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2999
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2988
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1303
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
564
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.