First make sure MySQL service is running and try logging into mysql with the mysql admin account. Or try it the easy way... reboot your server (if it's your own server) and check if everything is fine afterwards.
Usally the error message appears if something is wrong with mysql, so I think this issue is not really an osTicket issue. Just search on your favorite search engine for the error message and you will hopefully find a solution like:
http://stackoverflow.com/questions/4448467/cant-connect-to-local-mysql-server-through-socket-var-lib-mysql-mysql-sock
or
http://www.linuxquestions.org/questions/linux-software-2/can't-connect-to-local-mysql-server-through-socket-'-var-lib-mysql-mysql-sock-281557/