• 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

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

 
Ranch Hand
Posts: 141
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic