These forums are read-only!
MySQL Glassfish Breakdown
  • So... full disclosure: I'm not an IT guy, I'm a dev who's wearing multiple hats for a friends company on a very weekend job. Here's my current frustration: I have MySQL installed on Lenny and I'm running a Java web app on Glassfish using Hibernate. The problem is this same setup at home works fine (on Windows and OS X, yes I hate Windows too it just happens to be my most stable box at the moment, long story) but it doesn't seem to work on my slice. Hibernate throws exceptions and I suspect that due to the nature of these exceptions ("org.hibernate.exception.SQLGrammarException: Cannot open connection") MySQL or something is not configured right. I just did an apt-get package install of mysql-server and mysql-client. I'm sort of running out of time to get this working and it's keeping me up at night. I've tried almost everything I can think of, and I can say that I cannot netcat to localhost (I get "bad handshake") so I'm wondering (just maybe) that there is some ID10T MySQL thing I have missed.
  • Have you checked that you can connect using the mysql command line client, using the authentication details you have set in your program? I don't know anything about glassfish but that seems like a good test to make sure mysql is at least basically working.
  • Yeah, I'd just try logging in from the mysql command line and creating a user and then something like:

    create database dbname;
    create user username;
    grant all on dbname to user@localhost;
    

    I know some zany DB Admin will tell me off for using grant all, and their right .. but I know you just want to get it working.

    Make sure MySQL server is running to:

    sudo ps aux | grep -i sql