Find the answer to your Linux question:
Results 1 to 3 of 3
I have apache and php4 (and php4-mysql) running on my webserver. When trying to access the db from a PHP script, I get this: Code: Warning: Access denied for user: ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Guru sarumont's Avatar
    Join Date
    Apr 2003
    Location
    /dev/urandom
    Posts
    3,682

    mysql/PHP question


    I have apache and php4 (and php4-mysql) running on my webserver. When trying to access the db from a PHP script, I get this:

    Code:
    Warning: Access denied for user: 'guest@evocation' (Using password: YES) in /pub/www/media.php on line 25
    
    Warning: MySQL Connection Failed: Access denied for user: 'guest@evocation' (Using password: YES) in /pub/www/media.php on line 25
    Unable to open connection.
    I've used this command to add guest:

    Code:
    grant select on Media.* to guest@'%' identified by 'guest';
    And here's the PHP snippet that should handle the connection:

    Code:
    $link = mysql_connect( "evocation", "guest", "guest" ) or die( "Unable to open connection." );
    Anyone have any clues as to why I can't connect?
    "Time is an illusion. Lunchtime, doubly so."
    ~Douglas Adams, The Hitchhiker's Guide to the Galaxy

  2. #2
    Linux Guru
    Join Date
    Apr 2003
    Location
    London, UK
    Posts
    3,284
    after doing your mysql grant statement, you then need to do a "Flush privilages" statement as well.

    Jason

  3. #3
    Linux Guru sarumont's Avatar
    Join Date
    Apr 2003
    Location
    /dev/urandom
    Posts
    3,682
    Schweet. That worked. Thanks, J. Now all I have to do is learn some PHP.
    "Time is an illusion. Lunchtime, doubly so."
    ~Douglas Adams, The Hitchhiker's Guide to the Galaxy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •