• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Access denied error ....MySQL

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

 
Slideshow boring ... losing consciousness ... just gonna take a quick nap on this tiny ad ...
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic