Can't connect to local MySQL server through socket on Ubuntu.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sasimca007
    New Member
    • Sep 2007
    • 129

    Can't connect to local MySQL server through socket on Ubuntu.

    Hi friends,
    I installed mysql in ubuntu but, i don't know how to connect to that mysql. Actually we connect to postgresql by psql command, but when i tried to connect mysql with mysql command but it displaying this error:

    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

    when i give mysql databasename it displaying the following error:

    Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

    So friends, what is the solution for this problem?
    Last edited by Atli; Sep 27 '08, 06:48 PM. Reason: Changed the thread title to better describe the question.
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    Hi.

    I would guess that your MySQL service is stopped. It needs to be started before you can start using it.

    On Ubuntu, this command should start it up:
    Code:
    sudo /etc/init.d/mysql start
    P.S.
    Please try to give your threads descriptive titles, so that they can be found by others with similar problems and so the experts can quickly find threads they can help with.

    If your having trouble doing that, try using phrases you would be likely to use when searching for an answer in a search engine, like Google.
    You should also check out the Posting Guidelines for more tips on how to construct a good thread title.

    Thank you.
    Moderator

    Comment

    Working...