Access denied for user 'test'@'localhost.localdomain'
Posted by: kelly-keo
Date: August 04, 2005 10:20AM

All,

I'm using MySQL 4.1.9 on Linux, JDK 1.4.2, mysql-connector-java-3.1.10

I'm trying to connect to my mysql database in my my java application but keeps getting SQLException: Access denied for user 'test'@'localhost.localdomain' (using password: YES).

What am I doing wrong? Here's the code that I copied from the example in the docs:

// Register with database manager
try
{ Class.forName("com.mysql.jdbc.Driver").newInstance(); }
catch( Exception ex)
{ System.out.println(ex.getMessage());}

// Connect to database
try
{ Connection dbc = DriverManager.getConnection("jdbc:mysql://localhost/test?user=test&password=test");}
catch
{ // print error }

I am able to connect to my database fine using "mysql -utest -ptest test"

Please help!!! Thanks in advance.

Keo

Options: ReplyQuote


Subject
Written By
Posted
Access denied for user 'test'@'localhost.localdomain'
August 04, 2005 10:20AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.