472,782 Members | 1,008 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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 4321
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
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
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
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
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: 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
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
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
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
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
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
by: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
0
by: lllomh | last post by:
How does React native implement an English player?

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.