For When You Can't Have The Real Thing
[ start | index | login ]
start > mysql > Tomcat Connections

Tomcat Connections

Created by dave. Last edited by dave, 12 years and 101 days ago. Viewed 1,630 times. #1
[edit] [rdf]
labels
attachments

Problem:

An apache Tomcat application could not connect to the mysql database. The user was defined as username@localhost.

The error displayed was:

"#HY000Host 'localhost.localdomain' is not allowed to connect to this MySQL server"

Solution:

Ensure that in /etc/hosts, the localhost name is in as:

127.0.0.1  localhost localhost.localdomain

The resolver picks the first match; if the entry for localhost has localhost.localdomain as the first name associated with the IP address, then this is the name returned during reverse lookups. So you must either fix things so that the short name is first, or redefine all your users to be username@localhost.localdomain.

no comments | post comment
This is a collection of techical information, much of it learned the hard way. Consider it a lab book or a /info directory. I doubt much of it will be of use to anyone else.

Useful:


snipsnap.org | Copyright 2000-2002 Matthias L. Jugel and Stephan J. Schmidt