Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2002
    Location
    Nottingham, UK
    Posts
    37

    Unanswered: same problem

    I tried the GRANT syntax just like impu007, but I too am having this problem.

    PLEASE HELP. This is frustrating. I am new to MySQL.

    Cannot connect as anything other than root, using shell or PHP pages on localhost.

    Here's my error:

    [in shell]
    ERROR 1045: Access denied for user: 'greg@localhost' (Using password: YES)

    [in php page]
    Warning: Access denied for user: 'greg@localhost' (Using password: YES) in /[...]/dbtest.php on line 14

    (I'm developing under OS X 10.1, but that should not make a difference).
    ----
    system:
    Mac Powerbook 1GHz

  2. #2
    Join Date
    Nov 2001
    Posts
    1
    try this

    mysql -u greg -p

    this should give you a password prompt


    Then type the password.

    Let me know if that works for you. If not, do the following as well...

    add localhost and the hostname to Grant host list.


    Let me know if that works for you...


    (I think it more like a password issue when mysql is expecting a password and not getting it, its having a hickup)

  3. #3
    Join Date
    Jan 2002
    Location
    Nottingham, UK
    Posts
    37

    oh that wasn't it after all

    impu,

    thx for the quick feedback. I don't think that's the problem. it turns out, I CAN connect, even with PHP pages. It's just that there's something wrong in PHP pages, ONLY when I use an 'include' or a 'require'

    e.g.
    <?php
    include ("../includes/mysql_vars.php");
    ?>

    in the top of my php page. The included file contains static variables for use in interfacing with mySQL.

    So, I guess my problem is a PHP one, not a MySQL one. I fixed my problem by stating user, host, password IN THE PHP PAGE every time I want to connect, which is undesirable. I'll sort it out eventually, I suppose. Thx. anyone have other suggestions about this problem?
    ----
    system:
    Mac Powerbook 1GHz

  4. #4
    Join Date
    Feb 2002
    Posts
    2

    Solved

    I was getting the same thing. My whole problem was I didn't execute 'flush privileges' after granting/updating the tables. Did that and it worked fine. Hope it helps you lads.

  5. #5
    Join Date
    Feb 2002
    Posts
    2

    flush privileges

    I was getting the same thing. My whole problem was I didn't execute 'flush privileges' after granting/updating the tables. Did that and it worked fine. Hope it helps you lads.

Posting Permissions

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