Re: Connecting to database using Eclipse
Posted by: Macamba .
Date: April 08, 2017 08:20AM

Filipe Silva Wrote:
> Have you checked if you are able to connect with
> the user 'macamba' using the MySQL client?
> Are you sure you're using this same user and
> server in Eclipse?

Yes, I'm sure I could connect with the user 'macamba'. For development purposes I use username and password hard coded in the code. I've been doing it all the time. Only in production situations I comment out username and password. And I am able to login into my database using phpMyAdmin using this username and password.
class - actionPerformed: user 'macamba' with password 'BiGsEcReT' is trying to login

And in my logging I see what database (url and so on) I'm using, and what username/password combination:
class getInstance, properties='myapplication.jdbc', url='jdbc:mysql://localhost:3306/myapplication'

I have read the page ( you mentioned. That's why I wrote the result of the query in my original question.

Anyway. You would think logging using a terminal would solve the problem:
C:\wamp\bin\mysql\mysql5.7.9\bin>mysql -u macamba -p
Enter password: *********
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 98
Server version: 5.7.9 MySQL Community Server (GPL)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use timekeeper;
Database changed
mysql> set password = password('BiGsEcReT2');
Query OK, 0 rows affected, 1 warning (0.00 sec)


And next I tried to run my code again hoping everything is solved. But alas, not. Still my password is expired.

mysql> select user, host, password_last_changed, password_lifetime, password_expired from mysql.user where user='macamba';
| user     | host      | password_last_changed | password_lifetime | password_expired |
| macamba  | localhost | 2017-04-08 16:08:16   |                 0 | N                |
1 row in set (0.00 sec)

So, for what it's worth, you can see I'm trying the heck out in this problem, but not getting anywhere fast.

Options: ReplyQuote

Written By
Re: Connecting to database using Eclipse
April 08, 2017 08:20AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.