4 messages in com.mysql.lists.javaRe: Mysql:Jdbc error| From | Sent On | Attachments |
|---|---|---|
| Izzy | 16 Jun 2003 10:56 | |
| Jeff Newmiller | 16 Jun 2003 11:21 | |
| Izzy | 16 Jun 2003 12:30 | |
| alberto trivellato | 20 Jun 2003 05:26 |
| Subject: | Re: Mysql:Jdbc error![]() |
|---|---|
| From: | Izzy (cere...@wanadoo.nl) |
| Date: | 06/16/2003 12:30:54 PM |
| List: | com.mysql.lists.java |
Jeff Newmiller wrote:
On Mon, 16 Jun 2003, Izzy wrote:
Hi Peeps,
i have a problem connecting to the mysql db error message when connecting
Ex2: java.sql.SQLException: Invalid authorization specification: Access denied for user: 'x@localhost.domain' (Using password: YES) Exception in thread "main" java.lang.NullPointerException: <= caused beacuse of no connection to dbase
-----------------------------------
this is my setup:
---------------------------------- /etc/hosts
::1 localhost 127.0.0.1 localhost
My hosts file has the order of these reversed. I hope this is not a problem, but it might be.
i have changed this file and still the same error.
----------------------------------
/etc/resolv.conf
nameserver 192.168.10.1
----------------------------------
user (mysql)
host: localhost
If you think name lookup might be a problem, switching to IP address should prove or disprove that.
i used: 127.0.0.1 instead of localhost and still the same error
user: x password: x
----------------------------------
driver jdbc:mysql
"jdbc:mysql://localhost/dbname?user=xpassword=x"
Is this just a typo? no "&" after "user=x"?
Yes , sorry a typo.
Also, confirm that you can log on using the "mysql" commandline tool using that username and password.
Used this user to log in normally in mysql , this works just fine
I think the problem is, that i need to have user@host and not user@host.domain when logging into mysql because when i use mysql -h localhost.domain -u user -p i cant log in, however using mysql -h localhost -u user -p works just fine. and since the error states:
Access denied for user: 'x@localhost.domain' (Using password: YES)
it uses the localhost.domain as host instead just the localhost.
http://www.mysql.com/documentation/connector-j/index.html#id2763865
--------------------------------------------------------------------------- Jeff Newmiller The ..... ..... Go Live... DCN:<jdne...@dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go... Work:<Jef...@endecon.com> Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...2k
---------------------------------------------------------------------------




