List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:March 7 2003 3:30am
Subject:Re: ERROR 1045: Access denied for user:
View as plain text  
At 11:07 +1100 3/7/03, Ben Balbo wrote:
>Hi Steve,
>
>Really silly question, but you are reloading the tables once you
>change the grants, aren't you :-)
>
>mysqladmin -p reload
>
>B.

Yep, it's silly. :-)  Because GRANT automatically refreshes the
in-memory copies of the grant tables.

Steve, try this:

mysql> DELETE FROM mysql.user WHERE User = '';
mysql> FLUSH PRIVILEGES;

(FLUSH PRIVILEGES *is* necessary here, because the DELETE directly modifies
the grant tables, and you have to tell the server to refresh the in-memory
copies).

Then try to connect again.  Bet it'll work.

>
>In response to your mail sent on Friday, March 07, 2003 at 10:48:06 AM.
>
>>  Mysql version 3.23.55 Slackware linux 8.0
>>  Mysql version 3.23.55 OpenBSD
>
>>  I have tried 3 versions of mysql on linux and
>>  on OpenBSD. I have even tried compiling on linux
>>  from the source tarball.
>
>>  Without the GRANT privs to allow network access:
>mysql>> GRANT ALL PRIVILEGES ON db.*
>>      -> TO user@'192.58.197.0/255.255.255.0';
>>  (example), I would get a "you are not allowed to connect"
>>  error. Once I applied the grant to the user:
>mysql>> GRANT ALL PRIVILEGES ON db.*
>>      -> TO user@'%'
>>  the users table shows:
>>  | Host                        | User  |
>>  ---------------------------------------
>>  | %                           | user  |
>
>>  If I coonect to the database without a host, or
>>  with host set to localhost, I can connect fine. If
>>  I connect from another machine, or just use the DNS
>>  name on the local machine, I get:
>>  <shell> mysql -h 192.168.1.24 -u test -p
>
>>  ERROR 1045: Access denied for user: 'user@stripped' (Using
>>  password: YES)
>
>>  I have even tried connecting using the IP address. I have poured
>>  over the docs, and have tried all the scenarios of add hostnames
>>  to /etc/hosts etc. I even complied from source (glibc problem).
>>  No luck at all... Any ideas? I really need network access to the
>>  database.
>>  --
>  > Steve (egrep)

Thread
ERROR 1045: Access denied for user:Steve Pirk7 Mar
  • Re: ERROR 1045: Access denied for user:Ben Balbo7 Mar
    • RE: ERROR 1045: Access denied for user:Roger Davis7 Mar
      • RE: ERROR 1045: Access denied for user:Steve Pirk7 Mar
    • Re: ERROR 1045: Access denied for user:Steve Pirk7 Mar
    • Re: ERROR 1045: Access denied for user:Steve Pirk7 Mar
    • Re: ERROR 1045: Access denied for user:Paul DuBois7 Mar
      • Re: ERROR 1045: Access denied for user:Steve Pirk7 Mar
        • Re: ERROR 1045: Access denied for user:Steve Pirk7 Mar
        • Re: ERROR 1045: Access denied for user:gerald_clark7 Mar
          • Re: ERROR 1045: Access denied for user:Steve Pirk8 Mar