Quick Tip #1: MySQL Upgrade Error 2002

Print this articlePrint this article

Being an owner of VPS and taking all administrative tasks on your shoulders, If you are the owner of VPS, this type might just safe you from hours of stress.

It’s not a secret that maintenance can be something complicated. Naturally, Home or SoHo administrators, try to use shortcuts whenever possible. One of such shortcuts is automatic update. Luckily, in Linux it can be scheduled by CRON daemon, and can be checked not more often than once a month.

But then, one day you might see message like this:

mysqlcheck: Got error: 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) when trying to connect

After another, semi-successful MySQL update. What it means? It often means that server failed to run due to error in configuration. This is most probable when you have tweaked your database before for maximum performance, adding to /etc/my.cnf (or /etc/mysql/my.cnf) lines like skip-bdb or skip-innodb.

HowTo:

  1. Check /var/log/mysqld.log for MySQL related failures. This can be done by typing in 'tail /var/log/mysqld.log'.
  2. If it says something like "[ERROR] Unknown/unsupported storage engine: BDB", make sure to find any reference about in /etc/my.cnf and delete them.

You can do it by opening 'nano /etc/my.cnf', removing exhausting lines, pressing Ctrl+X and confirming saving. NOTE: This might require elevated permissions, such as by appending 'sudo ' to nano editor command, and inputting your administrative password.

Note also that it might indicate other error too. Consult your MySQL version documentation about it.

Note that the further it goes, the more it gets polished – the database – hence the more “useless” parts are removed. However, due to negligence of MySQL developers, each time they remove something, they leave you no backward compatible routine, to make it easily upgradable.

You can understand their opinion too – it is good to make administrators notice updates to their database. But suppose administrator is out for a while? One update and all sites go down.

The only way is not to update at all, or limit to security updates only. But we’ll cover it another time.

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <span>
  • Lines and paragraphs break automatically.
  • Each email address will be obfuscated in a human readable fashion or (if JavaScript is enabled) replaced with a spamproof clickable link.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
  • Each email address will be obfuscated in a human readable fashion or (if JavaScript is enabled) replaced with a spamproof clickable link.
Image CAPTCHA
Enter the characters shown in the image.