List:MySQL and Java« Previous MessageNext Message »
From:raffi@dcit.com Date:January 6 2003 9:26pm
Subject:Re: % doesnt match ip address sometimes in mysql 4?
View as plain text  
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. **
============================================================

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