PDA

View Full Version : mySQL/JAVA connection


MarcL
03-18-2009, 05:55 PM
Hi guys,

I'm having trouble running my codes, or rather connecting to mySQL.

Previously,i was able to connect to my database but after installing winamp server all the settings seem to be corrupted or edited. Although i did remember tweaking with the adminstrative tools > mysql settings to run manually, i tried changing it back to automatic but it just didn't work.

Now whenever i compile my codes, i get the following exceptions :


Enter your choice >com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

Last packet sent to the server was 0 ms ago.: Could not get database connection
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

Last packet sent to the server was 0 ms ago.



Any help would be appreciated. Thanks.

brad211987
03-18-2009, 08:59 PM
Are you sure that your MySQL server is running? It usually listens on port 3306 and may have a windows service associated with it that you can look at.

MarcL
03-19-2009, 12:38 AM
Under my services(Local) MySQL status is seen as Started, Startup Type Automatic. And i don't remember changing the port no.

Thanks.

brad211987
03-19-2009, 03:00 AM
Can you connect using the command line tools that come with MySQL?

MarcL
03-19-2009, 09:43 AM
i went to my Command Line Client and did a show databases;

I realized that it is a different set of databases, which i had previously work on with winamp server.

Those databases that i had done on with mySQL -Front are no longer seen.

brad211987
03-19-2009, 01:38 PM
Sounds like your settings have been over-written and you may need to re-create or find out if they are still stored in the old data directory and bring them into the new one.

MarcL
03-19-2009, 02:00 PM
i manage to revert it back to the old settings .. but it still having the above error msges.