Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Error...java.sql.SQLException:Access denied for user

843854Nov 2 2001 — edited Apr 26 2007
Hi,

I am getting the following error message while connecting with the MySQL .(O/S :Sun OS 5.6)

Error.....java.sql.SQLException: Invalid authorization specification: Access denied for user: 'some_user&password@localhost' (Using password: NO)

Note that i have given all permission to the user using,
GRANT ALL PRIVILEGES .......................

The code i have used to connect with the database is,

import java.io.*;
import java.sql.*;
class test
{
public static void main(String a[])
{
try
{
Connection con;
Statement stmt;
ResultSet rs;
Class.forName("org.gjt.mm.mysql.Driver");
con=DriverManager.getConnection(jdbc:mysql://localhost/db_name?user=some_user&password=some_pass");
stmt=con.createStatement();
//do something with resultset
}
catch(Exception e)
{
System.out.println("Exception in second try.."+e);
}
}
}

plese guide me on this problem to solve.
Thankz,
Bala.


Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 24 2007
Added on Nov 2 2001
13 comments
2,175 views