connexion tomcat/mysql: IP vs localhost

2004-03-29 Thread Guillaume Roger
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]


Re: connexion tomcat/mysql: IP vs localhost

2004-03-29 Thread David Smith
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]


Re: connexion tomcat/mysql: IP vs localhost

2004-03-29 Thread Guillaume Roger
David Smith a écrit :
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 ;
That was an idea I already had, and I checked that.

It is specified %, so I should be able to connect from everywhere.

The thing is that I connect always from the same box (tomcat and mysql 
are on the same box), but I have to specify in my jsp sometimes 
localhost, and sometimes the IP address to connect. I suspected 
alternatively mysql, the network configuration, tomcat... I must admit 
that I'm a bit lost.

Thanks for your help

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


Re: connexion tomcat/mysql: IP vs localhost

2004-03-29 Thread David Smith
Well, then I'm not sure what to tell you.  I use mysql all the time and 
have never had such an issue (Mandrake Linux 9.2, Tomcat 5.0.19, Apache 
2.0).  Very strange.  Are there any firewalls or internet connection 
sharing programs at work?

--David

Guillaume Roger wrote:

David Smith a écrit :

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 ;


That was an idea I already had, and I checked that.

It is specified %, so I should be able to connect from everywhere.

The thing is that I connect always from the same box (tomcat and mysql 
are on the same box), but I have to specify in my jsp sometimes 
localhost, and sometimes the IP address to connect. I suspected 
alternatively mysql, the network configuration, tomcat... I must admit 
that I'm a bit lost.

Thanks for your help

-
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]


Re: connexion tomcat/mysql: IP vs localhost

2004-03-29 Thread satbinder . singh
How do I unsubscribe from this mail group, as I keep getting mails every 
to minutes?



Re: connexion tomcat/mysql: IP vs localhost

2004-03-29 Thread eric sato
try here http://jakarta.apache.org/site/mail2.html#Tomcat

- Original Message -
From: [EMAIL PROTECTED]
Date: Tuesday, March 30, 2004 0:41 am
Subject: Re: connexion tomcat/mysql: IP vs localhost

 How do I unsubscribe from this mail group, as I keep getting mails 
 every 
 to minutes?
 
 


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



Re: connexion tomcat/mysql: IP vs localhost

2004-03-29 Thread Giuseppe Briotti
 ==
 Date: Mon, 29 Mar 2004 11:03:11 +0200
 jdbc:mysql://localhost:3306/appli
 jdbc:mysql://212.xxx.xxx.xxx:3306/appli

quite strange... what happens if you put 127.0.0.1 (i.e. the IP address for localhost)?

I think that, because you are working on a box (i.e. client and server on the same PC) 
this behaviour is related to your net configuration... check your hosts file.

G


--

Giuseppe Briotti
[EMAIL PROTECTED]

Alme Sol, curru nitido diem qui 
promis et celas aliusque et idem 
nasceris, possis nihil urbe Roma 
visere maius.
 (Orazio)



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