aspose file tools*
The moose likes JDBC and the fly likes Access denied error ....MySQL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Access denied error ....MySQL " Watch "Access denied error ....MySQL " New topic
Author

Access denied error ....MySQL

Balamurugan ponnambalam
Greenhorn

Joined: Nov 04, 2001
Posts: 1
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.

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Access denied error ....MySQL