From: "Teun Vink" <[EMAIL PROTECTED]>
> On Wed, 2002-08-28 at 16:51, Gene Grimm wrote:
> > [...]
> > I added the user name "spamby" to MySQL via webmin and set this in
> > config.inc.php as per the readme file. I confirmed the configured host,
user
> > and password by inserting an echo statement in the phpsa file. The
problem
> > is that I get the below error messages and can't figure out why it is
trying
> > to connect as root.

Please note: the script, to the best of my understanding, should NOT be
attempting to connect as "root", but rather as "spamby" being that this was
set in the script:

[from config.inc.php]
$dbhost = "localhost";
$dbuser = "spamby";
$dbpass = "somepassword";

[from phpsa.php]
include("config.inc.php");
    {start session here}
include("header.inc.php");
echo "Connecting to $dbhost as $dbuser<br>\n";  <<== This line added
$link = mysql_connect("$dbhost", "$dbuser", "$dbpass") or die ("Could not
connect");

After it reports "Connecting to localhost as spamby", the script spits out:

> > Warning: Access denied for user: '[EMAIL PROTECTED]' (Using password: NO)
in
> > /var/www/phpsa/phpsa.php on line 16
> >
> > Warning: MySQL Connection Failed: Access denied for user:
'[EMAIL PROTECTED]'
> > (Using password: NO) in /var/www/phpsa/phpsa.php on line 16
> > Could not connect
>
> It looks like the root account does not have permission to access the
> database in mysql, so I'd suggest you verify that. More info on that can
> be found here: http://www.mysql.com/doc/en/Adding_users.html.

The account the script should be connecting as is "spamby", whose
permissions in mysql are as follows:

[EMAIL PROTECTED], password encrypted, Select | Insert | Update | Delete

For the sake of argument, the permissions for "[EMAIL PROTECTED]" are:

[EMAIL PROTECTED], password encrypted, All


Reply via email to