Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2004

    Unhappy Unanswered: can't get to access database..why?

    hi..i'm a newbie and i need some help in mysql. i'm using mysql in redhat linux 9.

    i have created a database inside mysql

    however, when i logged into mysql as snort, i cannot access the snort database. why is it so?

    plz help ...

  2. #2
    Join Date
    Apr 2004
    Most likely user snort has no access rights on the database. Try to use the Grant statement ot give user snort some rights over the database tables!

  3. #3
    Join Date
    Oct 2004
    I had grant priviliges to the snort user.

    Host = localhost
    User = snort
    Password = snort
    Select_priv = Y
    Insert_priv = Y
    Update_priv = Y
    Delete_priv = Y
    Create_priv = Y
    Drop_priv = Y
    Reload_priv = Y
    Shutdown_priv = Y
    Process_priv = Y
    File_priv = Y
    Grant_priv = Y
    References_priv = Y
    Index_priv = Y
    Alter_priv = Y

    but i'm not sure if the privileges i granted was relevant or not.

    when i logged into mysql as snort user, it shows
    #mysql -u snort
    mysql> use snort
    ERROR 1044: Access denied for user: '@localhost' to database 'snort'

    i wondered if there's still other privileges that i havn't grant and i need to grant them?

    thanx for helping ...

  4. #4
    Join Date
    Apr 2004

  5. #5
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    When granting privileges I find it easier to use the grant command rather than a direct table edit.
    you need to check the exact syntax in the help or manual pages but I think its something like ....
    grant <privileges> on <database> to <user>.<host> indentified by <password>;

    then you need to issue the "flush privileges;" command to force a reload of the security policies

    this is not secure or reccomended for a production server but as and example

    grant all on *.* to snort.% identified by 'snortpass';
    flush privileges;

    this grants all privileges to user snort from any host where snort is using a password of snortpass

    You may need to add some single quotes around the, note use % as a wildcard

    alternatively you could use

    grant all on <table>.<database> to snort.localhost identified by 'snortpass';

    remember the 'flush privileges;'

  6. #6
    Join Date
    Oct 2004
    well i did grant the privileges using the statement below
    grant all on *.* to 'snort'@'localhost' identified by 'snort';

    but i did not type "flush privileges;"
    i guess that's where i went wrong

    thanx for all the help !!!
    i manage to log in mysql as snort user now ...

Posting Permissions

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