Professional Web Applications Themes

created new user but mysql refuses him access - MySQL

This is on Linux, mysql-4.1.22. As root, I created a user with grant select, insert, update, delete on WebChess to WCuser identified by 'WCpass'; and got "query ok". When I try to access mysql with WCuser, e.g. mysql -u WCuser --password=WCpass I get Error 1045 (28000) Access denied. In fact, I get this same error regardless of what I type in as the password. I did a mysqladmin reload, and then rebooted linux to restart the mysql server clean, but neither helped. I did a show grants for WCuser and it displayed the grants as requested in the original grants ...

  1. #1

    Default created new user but mysql refuses him access

    This is on Linux, mysql-4.1.22. As root, I created a user with

    grant select, insert, update, delete on WebChess
    to WCuser identified by 'WCpass';

    and got "query ok".

    When I try to access mysql with WCuser, e.g.

    mysql -u WCuser --password=WCpass

    I get Error 1045 (28000) Access denied. In fact, I get this same error
    regardless of what I type in as the password.

    I did a mysqladmin reload, and then rebooted linux to restart the mysql
    server clean, but neither helped. I did a show grants for WCuser and it
    displayed the grants as requested in the original grants command, plus grant
    usage on *.*

    What do I need to do to get mysql to recognize this user?

    Thanks,
    Cameron


    Cameron Guest

  2. #2

    Default Re: created new user but mysql refuses him access

    "Cameron Fitzhugh" <com> wrote:
     
    ^^^^^^
    You did not specify a hostname. A MySQL account is always userhost
    where the host part may contain wildcards. Just user is synonym for
    user'%'.
     

    Why didn't you copy the *complete* error message? I guess it reads:
    Access denied for user 'WCuser''localhost' (using password: YES)

    The problem is the 'localhost' part. A host '%' matches any host when
    the user connects via the network. It does not match connections from
    localhost (using the UNIX domain socket) if you have an anonymous
    account for localhost.


    From http://dev.mysql.com/doc/refman/5.0/en/access-denied.html:

    "A very common error is to insert a new entry with Host='%' and
    User='some_user', thinking that this allows you to specify localhost
    to connect from the same machine. The reason that this does not work
    is that the default privileges include an entry with Host='localhost'
    and User=''. Because that entry has a Host value 'localhost' that is
    more specific than '%', it is used in preference to the new entry when
    connecting from localhost! The correct procedure is to insert a second
    entry with Host='localhost' and User='some_user', or to delete the
    entry with Host='localhost' and User=''."


    XL
    --
    Axel Schwenke, Support Engineer, MySQL AB

    Online User Manual: http://dev.mysql.com/doc/refman/5.0/en/
    MySQL User Forums: http://forums.mysql.com/
    Axel Guest

  3. #3

    Default Re: created new user but mysql refuses him access

    On Jan 31, 12:56 pm, "Cameron Fitzhugh" <com>
    wrote: 

    After your grant statement, did you do:
    FLUSH PRIVILEGES;

    Until then, it doesn't matter what user or password you enter...

    Nino

    nino9stars@yahoo.com Guest

  4. #4

    Default Re: created new user but mysql refuses him access

    com wrote: 
    >
    > After your grant statement, did you do:
    > FLUSH PRIVILEGES;
    >
    > Until then, it doesn't matter what user or password you enter...
    >
    > Nino
    >[/ref]

    You shouldn't need to issue FLUSH PRIVILEGES after doing a GRANT. You
    only need to do it if you issue an INSERT or UPDATE to the user's table.

    --
    ==================
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    net
    ==================
    Jerry Guest

Similar Threads

  1. User Access to MySQL Database
    By Bob Sanderson in forum MySQL
    Replies: 6
    Last Post: June 3rd, 12:39 PM
  2. MySQL Access denied for user - Plesk / FC 2
    By rossn8tor@hotmail.com in forum Coldfusion Server Administration
    Replies: 1
    Last Post: November 9th, 04:31 PM
  3. ASP.NET User created on my system?
    By Jim in forum ASP.NET Web Services
    Replies: 2
    Last Post: November 11th, 01:05 AM
  4. No ASPNET user created
    By Jamie Anderson in forum ASP.NET Security
    Replies: 1
    Last Post: August 14th, 02:05 PM
  5. allowing newly created user accounts access to admin account software
    By Paul Henderson in forum Windows Setup, Administration & Security
    Replies: 0
    Last Post: June 30th, 08:36 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139