Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC-2a - "ant db" now works

 
Mark Beattie
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I finally got ant to drop and create new tables using 'ant db' on the command line.

The main problem I had was that MySQL keeps older files hanging around, making it difficult to get new configurations to work. Solution - remove MySQL then reinstall.

The build.xml problem: The first time I got MySQL to work I did not set up a user with a password. I was able to start MySQL from the command line using 'mysql -u root'. This did not work with the 'ant db' because the response I kept getting said something about using a password.

After a lot of experimenting and online research I came across a useful command: mysql -u root -p
-p means login with a password.
So, I configured MySql with a security password. Tested mysql -u root -p on the command line. Success! Then set the property files for the ant with the security password. Ran ant with the command 'ant db' Success! phew
 
Marilyn de Queiroz
Sheriff
Posts: 9059
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wonder if this is something new. Which version of mySQL are you using?
 
Mark Beattie
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The MySQL version, I think, is: 5.0.24a-community-nt

Regarding the build properties files. I am not sure that I tried out all the possible passwords properties in my userName.properties file:

...
db.userid=root
db.password=password

The above properties work for my current setup.

In the previous set up I tried 'null' but can't recall what else I tried.
 
Marilyn de Queiroz
Sheriff
Posts: 9059
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...
db.userid=root
db.password=

??
 
Mark Beattie
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Marilyn,

I cannot recall if I used:

db.password=

I probably left off the '=' sign and used:

db.password

I do recall removing db.password from the properties file and the the db.password codes from the build.xml file. That did not work.

I tried again just now with 'db.password='. I reconfigured the MySQL instance - this did not work. Then I removed and created a new MySQL instance - still did not work. For some reason the security password is still needed to access MySQL. I don't know why the application is so stubborn with me now.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic