aspose file tools*
The moose likes JDBC and the fly likes  MySQL is driving me nuts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark " MySQL is driving me nuts" Watch " MySQL is driving me nuts" New topic
Author

MySQL is driving me nuts

C. Magmanum
Ranch Hand

Joined: Apr 03, 2004
Posts: 35
I am new to SQL and I resently just installed MySQL server on my system. I also have Tomcat installed as my webserver.
This is my problem:

I keep getting this error when my JSP tries to connect to my database

Cannot connect to MySQL server on localhost:3307. Is there a MySQL server running on the machine/port you are trying to connect to?

Tomcat and MySQL both run on my machine!

and here is the java code in my JSP

Help please before I go insane, I've been on it for over 48 hours!
[ January 08, 2005: Message edited by: Bear Bibeault ]
Chris Montgomery
Ranch Hand

Joined: Jan 14, 2004
Posts: 141
isn't mysql on port 3306?
C. Magmanum
Ranch Hand

Joined: Apr 03, 2004
Posts: 35
I used port 3307 because I thought it was a problem with that port. Anyway, I have set everything back to default.
Now mysql is on port :3306 and my jsp refers to it on that same port but the problem still persists

I am using XP with service pack 2
Guy Allard
Ranch Hand

Joined: Nov 24, 2000
Posts: 776
How did you set up the 'register' database? Describe that in detail please.

What OS are you using, Windows or Unix?

-If Windows, make sure the Mysql NT service is started (control panel ...-> services)

-If Unix, make sure the Mysql daemons is up. Check it by:

ps -wf | grep -i mysql

Guy
pascal betz
Ranch Hand

Joined: Jun 19, 2001
Posts: 547
hi


- can you connect to localhost 3306 with telnet (to check if DB is up)
- try to replace localhost with 127.0.0.1 or the machine name/ip ?
- do you have any software firewall which could cause this ?
- did you modify java's security settings to deny access (i swapped in the wrong policy file once and searched for the "bug" for a longlong time ;-) )


pascal
C. Magmanum
Ranch Hand

Joined: Apr 03, 2004
Posts: 35
its working now! Thanks all. very much appreciated.
Sabari Girish
Greenhorn

Joined: Jan 13, 2005
Posts: 2
HI all,

I am also facing the same problem. Please let me know also how u solved the problem please.

Thanking u,
Sabari
Paymon Asadinia
Greenhorn

Joined: Jan 11, 2005
Posts: 8
Hi,

have you guys put all this information in the tomcat config file yet,
like the jdbc driver, name of your database, etc? I didn't seem to notice in your posts that, this was mentioned. just a thought

SCJP, SCWCD, SCBCD(In Progress)


Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30294
    
150

"schrodinger's cat",
We're pleased to have you here with us in the JDBC forum, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks,
Jeanne
Forum Bartender


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Andreas Andersson
Greenhorn

Joined: Jan 18, 2005
Posts: 1
I have the same problem. Here is the answere to most of the previous questions:

Yes, I can connect from prompt without problems
No, I can't connect via telnet (should that be possible?), not even from the localhost (tryed ip, hostname and localhost)
No, I can't connect from mysqlCC from another machine.

The daemon is running (otherwise I wouldn't be able to connect at all and I am).

Any ideas?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: MySQL is driving me nuts