Thanks, Ligaya.


Yes, the system name is "rh01", according to localhosts and /etc/net and /etc/sysconfig/network. Your question caused me to question my networking configuration, so I tried connecting to "localhost". That seems to work. Was able to add a row to the table.

Cheers, Drubl

----------------------

Also, made the code change you suggested. Same basic info returned in the browser:

*Warning*: Access denied for user: '[EMAIL PROTECTED]' (Using password: YES) in */var/www/html/mysql_connect.inc* on line *29*

*Warning*: MySQL Connection Failed: Access denied for user: '[EMAIL PROTECTED]' (Using password: YES) in */var/www/html/mysql_connect.inc* on line *29*
Could not connect to database. Please try again later


Access denied for user: '[EMAIL PROTECTED]' (Using password: YES)


Ligaya Turmelle wrote:


Is your host name "rh01"?  That is supposted to be the host name
(www.rh01.com) or IP address(127.0.0.1).  also try adding this:

$db_connection = mysql_connect ("rh01", "llama", "camel") OR die ("<font
color = \"red\" size = \"+2\">Could not connect to database. Please try
again later</font>". mysql_error());

At the very least it will allow the program to end gracefully and the
mysql_error() will tell you why.


"drubl" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]


Trying to get make my first PHP connection to a DB.

The mysql_connect appears to be the point of failure. The line number in
the error output correlates to the call.

Am able to use the same user, password, etc, to connect to the
"accounting" database as either user "llama" and user "root" using the
"mysql" interface.
Also tried using the root account which had the same results.

What am I missing? Seems too simple.
Could it be a configuration issue?

Many thanks for any insights!
drubl

--------------------------------------------------------------------------


---


Configuration:
----------------------
RH Linux 9
Apache 2.0.40
PHP 4.2.2
MySQL 3.23.54

Script:
------------------
<?php

// Connect to MYSQL
$db_connection = mysql_connect ("rh01", "llama", "camel");

// Select the DB
mysql_select_db ("accounting");

?>


Results displayed by browser: ---------------------------------

Warning: Access denied for user: '[EMAIL PROTECTED]' (Using password: YES) in
/var/www/html/mysql_connect.inc on line 26

Warning: MySQL Connection Failed: Access denied for user: '[EMAIL PROTECTED]'
(Using password: YES) in /var/www/html/mysql_connect.inc on line 26











-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to