"Can't connect to local MySQL server through" socket error [duplicate]

mysql can be started from upstart. Basically you install mysql-server package. You can easily search for mysql-server package in synaptic and install it. You will be prompted for root password during installtion[i.e.mysql user root password] . After that in terminal just do

sudo start mysql

or

sudo service mysql start

Mysql usually is started on boot so you may have it running as well.

Just ps aux | grep mysql to see if it is running.


Ubuntu 11.10: sudo dpkg-reconfigure mysql-server-5.1

Ubuntu 12.04: sudo dpkg-reconfigure mysql-server-5.5

Follow instruction then reboot.

This problem may happen when you upgrade from one ubuntu version to another and config gets messed up somehow. Usually the related to the startup process of mysql daemon mysqld)