I tried this.  The error I received is:  error: 'Access denied for user:
'root@localhost' (Using password: NO)'

Is there another option?



|---------+---------------------------->
|         |           "Dan Rossi"      |
|         |           <daniel@electrote|
|         |           que.org>         |
|         |                            |
|         |           11/08/2002 11:10 |
|         |           AM               |
|         |                            |
|---------+---------------------------->
  
>--------------------------------------------------------------------------------------------------------------|
  |                                                                                    
                          |
  |       To:       <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>                      
                          |
  |       cc:                                                                          
                          |
  |       Subject:  RE: Error connecting to Mysql via Apache/PHP -  Access Denied 
(Newbie)                       |
  
>--------------------------------------------------------------------------------------------------------------|




mysqladmin -u root password setpassword ? and dont use root for normal
access

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:CZachary@;wiley.com]
Sent: Saturday, November 09, 2002 2:51 AM
To: [EMAIL PROTECTED]
Subject: Error connecting to Mysql via Apache/PHP - Access Denied
(Newbie)


Hello all, I'm a newbie to Mysql.  I just installed mysql 3.23.53 on
Solaris 7.  I am running Apache 2.0.42 and PHP 4.2.3.

I am trying to connect to my Mysql DB via Apache and PHP, but I get the
following error: " Warning: MySQL Connection Failed: Access denied for
user: 'root@jws-portald' (Using password: YES) in helloSql.php on line 3
Could not connect"

Is there a step I missed during the Mysql setup?

Here is the code I used.

<?php
// Connecting, selecting database
$link = mysql_connect("localhost", "root", "mypassword")
    or die("Could not connect");
print "Connected successfully";


// Performing SQL query
$query = "SELECT now()";
$result = mysql_query($query)
    or die("Query failed");


// Printing results in HTML
print "<table>\n";
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
    print "\t<tr>\n";
    foreach ($line as $col_value) {
        print "\t\t<td>$col_value</td>\n";
    }
    print "\t</tr>\n";
}
print "</table>\n";


// Closing connection
mysql_close($link);
?>




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail
<[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php







---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to