My Django web app was working fine, writing data to a mysql database. However, sometime in the past 36 hours or so, it stopped working.

I typed "mysql" into the command line (i'm using ubuntu on amazon ec2) and the error was: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

I checked in /var/run/mysqld and mysqld.sock DOES NOT exist.

I tried to start and stopmysql server, but I get "job failed to start" when I typed "start mysql" and "unknown instance" when I typed "stop mysql"

I also tried to look for the mysql error log, but there's no files at all in /var/log/mysql and /var/log/mysql.log is a completely empty file.

Could anyone give me some pointers on where to look to troubleshoot this problem? Also, do you think all my data in the database is gone now?!?!?! I really hope it isn't...

I'm really an amateur at mysql, so I would appreciate any advice. Thanks in advance!

  • 1
    run mysqld that should spit out some data you can update your post with – Mike Jul 27 '12 at 5:41
  • Thanks! This was really helpful to me. Problem solved! (see below) – K L Jul 27 '12 at 5:50
  • I had added a line in my.conf about 'default-character-set=utf8' and apparently that was screwing the entire thing up. Though that line has been there for over a week already, so I'm not sure why the problem only emerged yesterday. – K L Jul 27 '12 at 5:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.