On Saturday 27 October 2001 10:10, shanmukha rao balla wrote:

> i had set proper classpath for jdbc drivers and my username ,
> password and database name,port no also correct.  i am able to
> connect to mysql server using that username,password at COMMAND
> line. but while connecting to database from above java program mysql
> server and program are running on the same system.

When you ran it at the command line, did you explicitly set the host
as you describe with "mysql -h localhost.localdomain" ?  If not, then
you're probably connecting to the server via a Unix socket, not a TCP
port.  And if that's the case, your server may not even be accepting
TCP recquests.  This is what happened to me - it's the default Debian
Linux configuration.  To find out if it is happening to you, try
running "mysqladmin variables" and checking the "port" variable.  If
it is 0, then you need to reconfigure your server to listen at ports.
If it is 3306, then you will need to get your permissions sorted out
(try using the mysqlaccess tool).

And you really, really shouldn't run this stuff as root.


Gordon

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to