title: Error 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
body: <p>I'm on Ubuntu 11.04. Everything works PHP, PHPMYADMIN, manual login to MySQL etc. </p>
  
  <p>I have written a C application that uses MySQL. Now, when I start this application I receive the above error. I tried to prevent that from happening by linking the original file into the /tmp/ folder (ln -s /var/run/mysqld/mysqld.sock /tmp/mysql.sock), however, after a while I start getting this error again - because my link has been removed, which is frustating. </p>
  
  <p>What do I need to do to make this work?</p>