Professional Web Applications Themes

grant problem: bug or feature? - MySQL

I run a grant command like this: mysql> grant all on db_name.* to user; As is said in mysql manual that simple form like 'user' is the same with 'user''%', and % means anywhere but localhost, so the above command means user can access db_name from anywhere but localhost. So on, so well. But I found in a occident that I CAN access db_name from localhost, in this way: bash# mysql -u user -p -h 192.168.0.9 where 192.168.0.9 is the ip of localhost. And I run this command on the same host as mysql server. Is this a bug or ...

  1. #1

    Default grant problem: bug or feature?

    I run a grant command like this:
    mysql> grant all on db_name.* to user;
    As is said in mysql manual that simple form like 'user' is the same with
    'user''%', and % means anywhere but localhost, so the above command
    means user can access db_name from anywhere but localhost. So on, so well.

    But I found in a occident that I CAN access db_name from localhost, in
    this way:
    bash# mysql -u user -p -h 192.168.0.9
    where 192.168.0.9 is the ip of localhost. And I run this command on the
    same host as mysql server.

    Is this a bug or feature? I think there is a bug in the doentation: %
    means anywhere, INCLUDING localhost.
    ۼӳ Guest

  2. #2

    Default Re: grant problem: bug or feature?

    On Mon, 09 Apr 2007 17:24:35 +0800, =?GB2312?B?ydu807OsIEplcnJ5IEZsZW1pbmc=?= wrote: 

    Depends on your perspective of "bug", I suppose. It's well-known and
    sorta-doented behavior. userlocalhost means connections through the
    unix socket at /var/run/whatever where this location is configured in
    my.ini, but it does not include any network connections, 127.0.0.1
    notwithstanding. user% means any network connection, including
    127.0.0.1, but does NOT include unix sockets.

    I suspect, as an outsider, that the reason that this is only
    sorta-doented is that there are some mysql developers that think this
    is a perfectly reasonable split of operation and very easy to program
    for, and another camp that thinks that "localhost" is a poor choice of
    term, since the localhost[.example.com] case is not part of it. Both
    camps are correct, but at odds with each other.

    --
    It's not hard, it's just asking for a visit by the up fairy.
    -- Peter da Silva
    Peter Guest

  3. #3

    Default Re: grant problem: bug or feature?

    >I run a grant command like this: 

    For a MySQL client, specifying the host as 'localhost' means to
    use a local UNIX-domain socket. It's *not* the same as 127.0.0.1 or
    the IP address of the host on the network. If you start mysqld with
    --skip-networking, you'll find that connections to 127.0.0.1 or the IP
    address of the host on the network don't work.
     

    I'll disagree, % means anywhere including the local host but excluding
    'localhost'. See the difference the quotes make?

    Failure to disallow access from the local host while allowing access from
    everywhere else is rarely a serious security problem.

    Gordon Guest

Similar Threads

  1. Problem with auto update feature
    By sincere_shari in forum Macromedia Shockwave
    Replies: 2
    Last Post: October 23rd, 11:49 PM
  2. Tab Feature Problem
    By Basiliki_Jerlinski@adobeforums.com in forum Adobe Indesign Windows
    Replies: 23
    Last Post: September 1st, 06:10 PM
  3. Your Favorite Feature & Worst Feature in Ill
    By LoveArt@adobeforums.com in forum Adobe Illustrator Macintosh
    Replies: 22
    Last Post: August 20th, 02:26 PM
  4. grant dba
    By tomL in forum Informix
    Replies: 2
    Last Post: January 22nd, 03:50 PM
  5. Grant not working
    By Bruce in forum PHP Development
    Replies: 3
    Last Post: December 19th, 03:57 AM

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