Re: Connector/J Changes localhost in connectstring to remote host name
Posted by: Mark Matthews
Date: September 08, 2005 07:51AM

Lukasz Palys wrote:
> Hallo,
>
> My problem is that if i try to connect with the
> following parameters:
>
> Connection connection =
> DriverManager.getConnection("jdbc:mysql://localhos
> t:3306/server", "manteufel", "pass");
>
> localhost is changed to the remoteadress.
>
> But i hava only rights to connect as
> manteufel@localhost and not
> manteufel@remotedaress.
> I have no posssibility to grant rights on mysql
> because my application is hosted by a provider.

Lukasz,

No, it does not. The error message"Invalid authorization specification: Access denied for user:
'manteufel@plesk3.ms.de.cdip.net' (Using password: YES)" means that the _server_ says you are connecting _from_ the host "plesk3.ms.de.cdip.net". The host name in the message comes from reverse-DNS lookup of the address the connection is being made _from_.

Usernames in MySQL contain two components, the username itself, and the host they are connecting from. You need to set up your GRANTs correctly to enable connections _from_ remote hosts.

-Mark

Mark Matthews
Consulting Member Technical Staff - MySQL Enterprise Tools
Oracle
http://www.mysql.com/products/enterprise/monitor.html

Options: ReplyQuote




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.