JDBC Mysql Connect Problem

C

Chow

Hi,

I am trying to deploy a web-app using Tomcat which has simple Java
beans using JDBC driver for mysql. I was able to use the same
application source code earlier and everything use to work fine. But
recently i upgraded my Redhat Linux fro 7.2 to 9.0. And ever since I
am not able to connect to my mysql server via JDBC drivers and also i
tried using PHP but no luck. I checked using netstat -a command and
saw that mysql is listening on a TCP port. And I checked for it in
process list also it looks fine there.

I am able to log into the sql command line tool and perform all the
sql tasks as usual. I am absolutely not sure what is going on with
connection to the database.

When I try using a standalone JDBC Java client, i get an error
saying "Could not establish connection to
JDBC:MYSQL://localhost:3306/test?username=user,password=pass"

I also checked the classpath and there is JAR file in the
environment variables.

Any help with this issue will be greatly appreciated. Thanks in
advance.

Regards,

Srinivasa.
 
G

GaryM

(e-mail address removed) (Chow) wrote in
JDBC:MYSQL://localhost:3306/test?username=user,password=pass"

My URI is different:

jdbc:mysql://host:3306/dbname?user=xxxxx&password=yyyy

Try using these parms insteads.
 
A

acey

Hi !
I am trying to deploy a web-app using Tomcat which has simple Java
beans using JDBC driver for mysql. I was able to use the same
application source code earlier and everything use to work fine. But
recently i upgraded my Redhat Linux fro 7.2 to 9.0. And ever since I
am not able to connect to my mysql server via JDBC drivers and also i
tried using PHP but no luck. I checked using netstat -a command and
saw that mysql is listening on a TCP port. And I checked for it in
process list also it looks fine there.

I am able to log into the sql command line tool and perform all the
sql tasks as usual. I am absolutely not sure what is going on with
connection to the database.

When I try using a standalone JDBC Java client, i get an error
saying "Could not establish connection to
JDBC:MYSQL://localhost:3306/test?username=user,password=pass"

You're in linux redhat 9.0.
What does your /etc/hosts look like ?
it should contain a line like this :
127.0.0.1 localhost

have you got a firewall running which would prevent connections ?
Remember as well that you must have a sql socket file( don't remember
the exact setting) .

If all else fails :), then look for google linux+ mysql + connection

Good luck :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top