Menu

#27 Database Connection Problem

closed
nobody
None
5
2002-07-29
2002-05-17
No

Hi,

I'm using mm.mysql-2.0.4, j2sdk1.3.1, and
mysql-3.23.49 on linux system. I'm having problem
connecting to database that require a user and
password. I don't have problem connecting to database
such as 'test' which is created when I installed mysql.

Here is my code:

<code>
try
{

Class.forName("org.gjt.mm.mysql.Driver").newInstance();
}
catch(Exception cnf)
{
System.out.println(cnf);
}
try
{
con =
DriverManager.getConnection("jdbc:mysql://tech:3306/VrAdmin?user=VrAdminDbo;password=VrAdminDbo");
}
catch(SQLException sqe)
{
System.out.print("SQLException occured " +
sqe.getMessage());
}
<code>

Here is the Exception:
SQLException occured General error: Access denied for
user: '@tech' to database 'VrAdmin'

I don't problem log in to the MySQL database using
command line:
% mysql -u VrAdminDbo -p VrAdmin

Again, if I change database to 'test', then I don't
connection problem. Does this I have to create all the
tables in 'test' database in order to excess them?
Obviousely I can't do anything with the database
'VrAdmin' that I just created.

Thanks in Advance.

Regards,
Sengen

Discussion

  • Sengen Prasomsouk

    Logged In: YES
    user_id=546585

    Thanks to Mark Matthews...It's working now.

     
  • Mark Matthews

    Mark Matthews - 2002-07-29

    Logged In: YES
    user_id=116907

    First, download version 2.0.14 and read the README that
    comes with it. (Hint your URL format is nothing like the
    documentation that comes with the driver describes).

    Then, you will need to grant rights to VRAdmin@tech in
    MySQL.

     
  • Mark Matthews

    Mark Matthews - 2002-07-29
    • status: open --> closed
     

Log in to post a comment.