[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mysql-bugs
Subject:    Re: Bug: Hostname not matching when user connects from localhost
From:       Sinisa Milivojevic <sinisa () mysql ! com>
Date:       2002-06-10 12:26:22
[Download RAW message or body]

Bernard writes:
> I use the mm JDBC driver.
> 
> When a Java program connects to mysql, the host name it is connecting
> _from_ is generated from the first entry in the file /etc/hosts.
> 
> How-To-Repeat:
> 
> In my setup (Redhat Linux) this line is:
> 127.0.0.1      localhost.localdomain   localhost
> 
> So there are 2 entries and the first "localhost.localdomain" is used.
> 
> If I create a user according to the mysql manual such as with:
> 
> insert into user (host,user,password,File_priv)
>        values('localhost','username',password('password'),'Y');
> insert into db
>        (host,db,user,Select_priv,Insert_priv,Update_priv,Delete_priv,
>         Create_priv,Drop_priv,Alter_priv)
>        values
> 
> ('localhost','table_prefix%','username','Y','Y','Y','Y','Y','Y','Y');
> 
> then it can't connect because I used the wrong host name localhost and
> not  localhost.localdomain.
> 
> This is a messy thing that gets screwed up so easily.
> I would rather use the IP address.
> 
> Do you have a better solution to this?
> 
> Regards,
> Bernard
> 

Hi!

What version of MySQL are you using ??

I changed my /etc/hosts and tried the above with 4.0.2 and 3.23.51 and
all worked fine for me.

I hope that you are using our latest binary.

What is the exact error message that you get ??

It is quite possible that you did not reload privileges after you have
done the above inserts.

Also, please do not mess with MySQL privilege tables directly, but
follow our instructions in the manual and use GRANT /  REVOKE commands.

-- 
Regards,
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Mr. Sinisa Milivojevic <sinisa@mysql.com>
 / /|_/ / // /\ \/ /_/ / /__   MySQL AB, Fulltime Developer
/_/  /_/\_, /___/\___\_\___/   Larnaca, Cyprus
       <___/   www.mysql.com


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail bugs-thread12094@lists.mysql.com
To unsubscribe, e-mail <bugs-unsubscribe@lists.mysql.com>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic