List:MySQL and Java« Previous MessageNext Message »
From:raffi@dcit.com Date:January 7 2003 5:08pm
Subject:Re: % doesnt match ip address sometimes in mysql 4?
View as plain text  
Yes exactly.
What are the rules that have changed?
Or is it a bug?


mike markovich wrote:
> But his question is why does it run on 3.23 and not on 4.  I
> installed and ran his code and my box and his code works fine.   I'm
> on NT with MySQL 3.23.  I ran the code as is and I didn't need to use
> any MySQL commands at all and I didn't have to grant any authorities.
> My understanding is that the two statements below create "doc" as a
> super user, perhaps this is not the case in 4.  So I suspect either a
> bug or that the rules have changed.  Any thoughts?
> 
> stat.execute("GRANT ALL PRIVILEGES ON *.* TO doc IDENTIFIED BY 'doc'
> WITH GRANT OPTION"); stat.execute("GRANT ALL PRIVILEGES ON *.* TO
> doc@localhost IDENTIFIED BY 'doc' WITH GRANT OPTION");
> 
> 
> -----Original Message----- From: Tim Endres
> [mailto:time@stripped] Sent: Tuesday, January 07, 2003 7:43 AM 
> To: raffi@stripped; java@stripped Subject: Re: % doesnt match
> ip address sometimes in mysql 4?
> 
> 
> Look at the mysql.user table to see if the user 'doc' has permission
> to access the tables 'dwarves'. If not, that is the problem. If so,
> then you have the infamous localhost.localdomain problem.
> 
> tim.
> 
> 
>> Hi Tim. Not sure what you mean by "copy the table to the new
>> server..." Just to eliminate any extraneous variables, I'm just
>> working with a fresh installation of the latest mysql 4. I start it
>> up empty "stock, out of the box" and I try to connect with the code
>> below. I get the error described.
>> 
>> I'm stumped. Is it me, or is it a bug?
>> 
>> Thanks for any help.
>> 
>> 
>> Tim Endres wrote:
>> 
>>> Did you copy the mysql.user table to the new server so that you
>>> have the same permissions? tim.
>>> 
>>> 
>>> 
>>>> Hi all.
>>>> 
>>>> Does anyone know why the following code DOES NOT work on mysql
>>>> 4.0.7-nt gamma and it DOES work on MySQL 3.23.whatever-nt.
>>>> 
>>>> Here is what you will get on MySQL 4... General error: Access
>>>> denied for user: 'doc@stripped' to database 'dwarves'
>>>> 
>>>> I've tested on a brand new installation as well. Same problem.
>>>> 
>>>> Why??? Thanks.
>>>> 
>>>> 
>>>> 
>>>> --------- example code ------------
>>>> 
>>>> public static void main(String[] args) { try { 
>>>> Class.forName("org.gjt.mm.mysql.Driver").newInstance(); 
>>>> Connection c = 
>>>> DriverManager.getConnection("jdbc:mysql://localhost/","root","");
>>>>  System.out.println("connected to database as root"); Statement
>>>> stat = c.createStatement(); stat.execute("GRANT ALL PRIVILEGES
>>>> ON *.* TO doc IDENTIFIED BY 'doc' WITH GRANT OPTION"); 
>>>> stat.execute("GRANT ALL PRIVILEGES ON *.* TO doc@localhost 
>>>> IDENTIFIED BY 'doc' WITH GRANT OPTION"); stat.execute("create
>>>> database dwarves"); c.close();
>>>> 
>>>> Connection cc = 
>>>> DriverManager.getConnection("jdbc:mysql://localhost/","doc","doc");
>>>>  System.out.println("connected to database as doc"); stat =
>>>> cc.createStatement(); stat.execute("GRANT All PRIVILEGES ON
>>>> dwarves.* TO dopey IDENTIFIED BY 'dopey'"); stat.execute("GRANT
>>>> All PRIVILEGES ON dwarves.* TO dopey@localhost IDENTIFIED BY
>>>> 'dopey'"); c.close();
>>>> 
>>>> } catch (Exception e) { System.out.println(e.getMessage()); } }
>>>> 
>>> 
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>>  Before posting, please check: http://www.mysql.com/doc/
>>> (the manual) http://lists.mysql.com/           (the list archive)
>>> 
>>> 
>>> To request this thread, e-mail <java-thread4843@stripped> 
>>> To unsubscribe, e-mail
>>> <java-unsubscribe-raffi=dcit.com@stripped>
>> 
>> -- Raffi Minassian DCIT Corporation http://www.dcit.com 
>> ============================================================ **
>> Nothing is so embarrassing as watching someone do something that
>> you said couldn't be done. ** 
>> ============================================================
>> 
>> 
>> ---------------------------------------------------------------------
>>  Before posting, please check: http://www.mysql.com/doc/
>> (the manual) http://lists.mysql.com/           (the list archive)
>> 
>> To request this thread, e-mail <java-thread4845@stripped> To
>> unsubscribe, e-mail <java-unsubscribe-time=ice.com@stripped>
>> 
>> 
> 
> 
> ---------------------------------------------------------------------
>  Before posting, please check: http://www.mysql.com/doc/         (the
> manual) http://lists.mysql.com/           (the list archive)
> 
> To request this thread, e-mail <java-thread4849@stripped> To
> unsubscribe, e-mail
> <java-unsubscribe-mikemarkovich=amyskitchen.net@stripped
> 

-- 
Raffi Minassian
DCIT Corporation
http://www.dcit.com
============================================================
** Nothing is so embarrassing as watching someone do
something that you said couldn't be done. **
============================================================

Thread
% doesnt match ip address sometimes in mysql 4?raffi@dcit.com6 Jan
  • Re: % doesnt match ip address sometimes in mysql 4?Tim Endres6 Jan
    • Re: % doesnt match ip address sometimes in mysql 4?raffi@dcit.com6 Jan
      • Re: % doesnt match ip address sometimes in mysql 4?Tim Endres7 Jan
        • Re: % doesnt match ip address sometimes in mysql 4?raffi@dcit.com7 Jan
    • Re: % doesnt match ip address sometimes in mysql 4?Luca Lafranchi7 Jan
RE: % doesnt match ip address sometimes in mysql 4?mike markovich7 Jan
  • Re: % doesnt match ip address sometimes in mysql 4?raffi@dcit.com7 Jan