How to get authorized using MySql?

I run MySql under Solaris 8 very well. I inserted a user called jack into the user table of mysql database like this: mysql>INSERT INTO user (Host, User, Password) -> VALUES('localhost', 'jack', PASSWORD('johnson')); Query OK, 1 row affected (0.00 sec) I checked the table, and see that user jack is there. Here is a part of my JDBCtest code, which accesses the demodb database I have created for test use. import java.net.*; import java.sql.*; import java.io.*; import java.util.*; class MySqlTest { public static void main(String [] args) { try { Class.forName ("org.gjt.mm.mysql.Driver"); java.sql.Connection con; con=DriverManager.getConnection("jdbc:mysql://localhost/demodb", "jack", "johnson"); ...... } The code compiles successfully, but when I run the bytecode, I get an exception. Look here: # java MySqlTestjava.sql.SQLException: Invalid authorization specification: Access denied for user: 'jack@localhost' (Using password: YES) #

Don't worry about the driver. I think the driver is working well, otherwise, I would have got another exception concerning the driver. So what is the problem? How should I fix it please? Thanks a lot. [ March 10, 2002: Message edited by: Gene Chao ]

You must add jack@localhost in your access table. In my system, the domain added by the commandline tool is "username@localhost.localdomain" or username@real_host_name I suggest you to log in from the commandline utility and explicitly run the following: mysql> GRANT ALL PRIVILEGES ON *.* TO jack@localhost IDENTIFIED BY 'some_pass' WITH GRANT OPTION;