• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

another 'Access denied for user 'foo'@'localhost' problem

 
Stuart Rogers
Ranch Hand
Posts: 141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java 1.7
Spring 3.1.1 with Spring-WS 2.1.1
Joda
Hibernate 3.6
MySQL 5.0.51a
Maven 3
Tomcat 7
Eclipse 3.7

Greetings all...

Just another 'Access denied for user 'foo'@'localhost' error being thrown by my webapp, but with a twist.

I run both an instance of MySQL on my (duh) local machine for development, and another on my remote server.

Both instances have a database 'mydb' and two tables with identical names and structures.

On the local instance I use root.

On the remote machine I have issued the following sequence:


I've confirmed with a 'select * from mysql.db' that three new rows appear and that all the appropriate fields have 'Y' values.

On the local machine from within a Command Prompt pane I can issue:

reply with the password mypwd and do get connected to the remote db.

Executing my java program fails with the famous
'Access denied for user 'fubar'@'localhost'
when url is adjusted to point to remote server

Using the following as part of my db.properties file in my Eclipse project:

execution works great

execution fails with the dreaded error when using this:


So I am stumped. How is that I can connect directly to the remote instance of MySQL server using the command line but not in my db.properties file?

TIA,

Still-learning Stev
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic