Ubuntu – “Can’t connect to local MySQL server through” socket error

MySQL

I install mysql and try start

/usr/local/mysql/bin# ./mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
/usr/local/mysql/bin#

Any Idea?

Best Answer

  • 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.

  • Related Question