Several things.

Don't use root to connect remotely.

Run mysqld as a userid on the server not root.

You may need to grant on mysql database for more than localhost.
Such as 

(Note this grants all privileges to all databases. See mysql docs
for restricted access)

GRANT * ON *.* TO 'userid' IDENTIFIED BY 'password';
GRANT * ON *.* TO 'userid@%' IDENTIFIED BY 'password';
GRANT * ON *.* TO 'userid@realhostname' IDENTIFIED BY 'password';

DONT FORGET TO ->

FLUSH PRIVILEGES;

Also be sure the file /etc/hosts has this line

127.0.0.1 localhost



Oh and I have to say this for the list-> sql, query

~Kelly W. Black

-----Original Message-----
From: Mertens Bram [mailto:bram-mertens@;linux.be]
Sent: Friday, November 08, 2002 9:55 AM
To: mysql mailing list
Subject: Re: Error connecting to Mysql via Apache/PHP - Access Denied
(Newbie)


On Fri, 2002-11-08 at 16:51, [EMAIL PROTECTED] wrote:
> 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"

Can you try to access a db as normal user?  Or is there a reason you
want to connect to the db as root?

I use a MySQL user without password and I connect with a command like:
$db = mysql_connect("localhost", "M8ram", "");
mysql_select_db("db_name",$db);


Perhaps you have to check the 'case' of your username?

HTH
-- 
 #  Mertens Bram "M8ram" <[EMAIL PROTECTED]>   Linux User #249103  #
 #  Red Hat Linux 7.3  KDE 3.0.0-10  kernel 2.4.18-3  i686  128MB RAM  #


---------------------------------------------------------------------
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