powered by Jive Software

Localhost and localhost.localdomain on MySQL


I have a messenger user with the right privileges for a messenger database on localhost (+mysql -u messenger -h localhost -p +is ok)

During the installation, I have jdbc:mysql://localhost:3306/messenger and the installer gives the following error:

A connection to the database could not be made. View the error message by opening the "/logs/error.log" log file, then go back to fix the problem.

In the log, jive_messenger tries to connect with localhost.localdomain instead of localhost (??!!), as follows:

java.sql.SQLException: Data source rejected establishment of connection,  message from server: "Host ''localhost.localdomain'' is not allowed to connect to this MySQL server"

I have to edit the mysql user’'s host to localhost.localdmain to continue the installation although I have jdbc:mysql://localhost:3306/messenger



Well, if you use the name “localhost”, I guess that the JDBC driver (or - the relevant OS parts) do a lookup. That should (…) return After that the mysql server looks up the incoming address (reverse) to find out the host/domain you are from. If you added localhost to the hosts file (/etc/hosts for *nix, %sysdir%driver/etc/hosts or something like this for win) with a public/private (not address that might cause this problem.

The same might be true for adding localhost.localdomain for the IP

The basic problem is, that mysql distinguishes between collections from localhost and collection from “everywhere else”… So the wildcard % as a host won’‘t work for localhost - and localhost won’'t do it for any other domain the connection seems to come from.

Short answer: Please check your hosts file and - if that’'s fine - check your DNS configuration.

Regards and HTH,