I think you're missing a few things:

1) Does your user have a password set?  If it does, u need to use the
following line to pass your username and password:

Connection connection = java.sql.DriverManager.getConnection(
      "jdbc:mysql://localhost:3306/test", "username", "password");

2) You need to allow your user 'icecream' to connect.  I don't really
understand the fine grain details of the grant statement, but u need to
grant permissions in mysql similar to the following:


GRANT ALL ON test.* TO 'icecream'@'localhost.localdomain';
FLUSH PRIVILEGES;

Have a look at the grant command.

I have a question about myCC.  I can't connect to a local linux machine for
the life of me from my win2k box.  I've done the following:

GRANT ALL ON test.* TO 'fred'@'192.168.0.230';
FLUSH PRIVILEGES;

but, in my mysql.log I still get:

020816 14:11:18       6 Connect     Access denied for user:
'[EMAIL PROTECTED]' (Using password: YES)

My user table looks like:
mysql> select user,host from user;
+--------+-----------------------+
| user   | host                  |
+--------+-----------------------+
| root   | 192.168.0.230         |
| fred   | 192.168.0.230         |
|        | lancelot              |
| root   | lancelot              |
|        | localhost             |
| fred   | localhost             |
| root   | localhost             |
+--------+-----------------------+

If anyone has an idea, please let me know.

Cheers,
Fred

> -----Original Message-----
> From: anand v [mailto:[EMAIL PROTECTED]]
> Sent: 22 August 2002 04:58
> To: [EMAIL PROTECTED]
> Subject: MySQL Connector/J 2.0.14 issue
>
>
> Hi,
>
> I have redhat 7.1 and I am using mysql server 3.23.36
> and I could login as a user to the linux server and run
> mysql program from the command line and connect to database
> I want to and do all SQL commands without any problems...
>
> But when I run a program that has
>
> Class.forName("org.gjt.mm.mysql.Driver").newInstance();
> Connection connection = java.sql.DriverManager.getConnection(
>      "jdbc:mysql://localhost:3306/test");
>
> I am getting this error when I run this code
>
> java.sql.SQLException: Invalid authorization specification: Access denied
> for us
> er: '[EMAIL PROTECTED]' (Using password: NO)


---------------------------------------------------------------------
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 <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to