View Single Post
  #1 (permalink)  
Old August 29th, 2003, 09:44 AM
Martyn Martyn is offline
Friend of Wrox
Join Date: Jun 2003
Location: , , .
Posts: 175
Thanks: 0
Thanked 0 Times in 0 Posts
Default Other things to try

I've been thing about your problem and here a few other thoings to try:

When you log into the database form the console the hostname is and when Tomcat logs into the database it uses the host localhost. Make sure that you have both hostnames listed in the user-table (I know people have solved this solved this by setting the host-name to '%'). You could also try to use the URL jdbc:mysql://

GRANT ALL ON dbname.* TO "username"@hostname IDENTIFIED BY "password"

Confirm that you have the correct password in the connection string. Also, check the spelling and the case. Use something like this:

getConnection( "jdbc:mysql://localhost/mydbname", "myusername", "mypassword" );

Good luck....