Are you sure it's not MySQL being funny? Try going in to mysql as root and executing this query:

select user, host from mysql.user ;

Take a look at the host field for the user tomcat is logging in as. If it specifies anything other than %, you may end up having to put in a row for every identity your computer can be. I've had that trouble myself. I want it restricted so only the tomcat server is getting in as the webapp user. Anyone else would be rejected even if they did manage to get the username and password. To do that, I had to cover my bases and put in a row for each: localhost, 127.0.0.1, the IP address, and the FQDN of the machine tomcat was on.

--David

Guillaume Roger wrote:

Hi all,

I've a problem while connecting to mysql from tomcat.

There is a bean which initializes the connexion between tomcat and mysql. The parameter which seems to be faulty is the url: "jdbc:mysql://localhost:3306/appli"


After a reboot, this url caused an error, ie the connexion between mysql and tomcat was not up. The url had to be replaced by the following: "jdbc:mysql://212.xxx.xxx.xxx:3306/appli", ie I had to put the IP address instead of localhost, without understanding why, whearas no modification relating to this had occured.


All was going well until another reboot, after which I had to put the old line back, with localhost, always without understanding why.

The searches on google, mysql and tomcat sites didn't bring me a solution.

Here is the configuration of my box:

redaht 7.2
mysql 3.23
tomcat4 4.1.10
j2sdk 1.4.0


Could anyone explain me why sometimes the IP address should be put, and sometimes localhost? I'd like to make it work at any time.


Thanks,


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to