2 messages in com.mysql.lists.javaRe: Fwd: Connecting to the MySql Data...
FromSent OnAttachments
Vijay Narayanasamy11 Nov 2001 11:46 
Gabor Niederlaender11 Nov 2001 23:33 
Subject:Re: Fwd: Connecting to the MySql Database (fwd)
From:Gabor Niederlaender (h995@maestria.wu-wien.ac.at)
Date:11/11/2001 11:33:42 PM
List:com.mysql.lists.java

Hi!

I had the same problem about one week ago, and I managed to get it work by now. The answers I got, were:

the problem is that mysql has a list of hosts that connections can be accepted from, localhost and localhost.localdomain are in there by default, which is why it works when you telnet in. You will need to get an admin (or get admin priveleges yourself) to allow other hosts to connect. the best thing in this case is to just setup a username/pw combo for you and set the host to '%' so any host is accepted. Unfortunately without an account to mysql, I'm not sure what else you can do.

AND:

i think that the db allows connects without user and password on LOCALHOST. if you connect from another machine (with your browser) the db denies the connect. use the GRANT command in mysql to get access from another machine.

try mysql> GRANT ALL ON yourdb.* TO username@machinename IDENTIFIED BY 'password' or mysql> GRANT ALL ON yourdb.* TO username@ip IDENTIFIED BY 'password' or mysql> GRANT ALL ON yourdb.* TO username@'%' IDENTIFIED BY 'password' (for access from all machines in the world) :-)

I hope they'll help you too.

Bye,

Gabor