• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Setting up user name in MySQL problem

 
Rob Petterson
Ranch Hand
Posts: 149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm Trying to connect to MySQL DB.
This is part of the code I'm using to this:
.....
con = DriverManager.getConnection("jdbc:mysql://localhost/wrox ?user=username&password=user_password");

.....
When I run the code I get:
Invalid authorization specification: Access denied for user:'username@localhost' (using:YES)
I realize I have to replace 'usename' and 'user_password' in the code for names I have defined. I don't have a problem with the user_password. I changed this in mysqladmin to my own password. The problem I'm having is how to change the username.
Please help - as I'm getting a very sore head from banging my head on the VDU for the last 4 hours!
 
Rob Petterson
Ranch Hand
Posts: 149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, I took a break and came back to it.
I've worked out where I was going wrong.
I needed to put in mysqladmin:
mysqladmin --user=username here --password=your password here
Hey presto, I now get connected!!!
[ December 07, 2002: Message edited by: Rob Petterson ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic