Monday, March 9, 2009

Hell with vista and ipv6 and hosts file

hmmm

Just had an amazing amount of time wasted whilst building a grails app. Still not exactly sure what they hell happened here. I think maybe and auto update on vista. Anyway I have had a problem for the last 2 hours with my grails apps suddenly not being able to connect to my local mysql instance. So i knocked up a small java app that just connected to the db and it had the same problem.

I could connect just find from the command line with mysql client but not java. Anyway after much much digging it seems to have been maybe a change to my hosts file.

it did say this:

#############
::1 localhost

and when i tried to connect via java to url jdbc:mysql://localhost/test then i got a nasty connection refused.

However when i changed this to

#############
127.0.0.1 localhost

Now it all seems to work.

It seems from searching around that the ::1 setup is for ipv6. Anyway jus thought i would document this ask it was painful to fix.

Maybe i should move back to ubuntu. See if they have fixed the rendering in java on linux finally.

4 comments:

Hrishi Dhruv said...

Hi Peter,

Thanks for this post. I have been struggling since yesterday to figure out what the issue was.
You save me a lot of time and effort.

Thanks again!
-Hrishi

Darius said...

Hi,

Dude you rock!!!
After spending 2 hour reading all kind of speculations why this error appears your solution was so simple and it worked perfectly.

I do remember of a vista alert regarding a mallware and telling me that it will change my hosts file. After that everything went crazy.

Thanks a lot.

research paper services said...

I had the same problem. I didn't get the Vista, I want my XP Professional back! ))

buying a term paper said...

^ what problem, bro?? just delet it and install XP again. or you didn't know how to do it???