Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I recently installed MySQL on my machine using MySQL installer. I am using it as part of an Apache Tomcat server I'm running on localhost.

I linked the database to Netbeans and everything was working fine. A couple of weeks ago I accidentally shut off my machine - the battery became disconnected - and when I turned it back on I could not connect to the database.

Whether I tried to connect via the command line, MySQL workbench or Netbeans I got an error telling me I could not connect to the database.

I've tried the following to fix the problem -Reinstalled MySQL server, workbench, etc -Reinstalled MySQL in different location -Stopped MySQL via the services window and started it again -Reconnected to Netbeans

Here's an example of the errors.

I get this when testing the connection while creating a new connection in Workbench:

enter image description here

After I make a connection (ignoring the fact the connection test fails) and trying to connect (still in Workbench)

enter image description here

Can someone please please help me? This is for my final year college project and I haven't been able to do anything for the past couple of weeks because of this. It's really annoying and I've tried everything I can think of.

share|improve this question

migrated from stackoverflow.com Dec 10 '11 at 21:21

This question came from our site for professional and enthusiast programmers.

    
You didn't say if MySQL is actually running while you run these tests. Please note that "actually running" != "I started the service". You also didn't say what you found in the MySQL error log when you looked at it. 'cause you looked there first, right? –  Luke404 Dec 10 '11 at 22:29
    
Right, I tried telnet localhost 3306 and got this error: Could not open connection to the host, on port 3306: Connection failed. –  Brian Byrne Dec 11 '11 at 14:45

1 Answer 1

Open up command prompt and type :

netstat -anto | findstr 3306

If you get output the mysql server is running , else the server is not running in this case check mysql service status in services.msc

share|improve this answer
    
That's not answering my question, but I get no output, just a blank line. I'm not having trouble running the sever - rather I'm having trouble connecting to it. –  Brian Byrne Dec 11 '11 at 13:55
    
Got it! I used the steps outlined here: stackoverflow.com/questions/2547855/… –  Brian Byrne Dec 11 '11 at 15:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.