Results 1 to 3 of 3

Thread: unable to connect to mysql

  1. #1
    Join Date
    Jun 2012
    Beans
    9

    unable to connect to mysql

    Hi,

    I am sorry for posting a popular question, but no available solution could help me.

    mysql -uroot -p
    Enter password:
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

    I did:
    me@System / $ ps -e|grep mysqld
    5354 pts/0 00:00:00 mysqld_safe
    5713 pts/0 00:00:07 mysqld

    I even can see that phpmyadmin is working.
    Kindly suggest me some solution.

  2. #2
    Join Date
    May 2010
    Location
    uk
    Beans
    8,077
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: unable to connect to mysql

    Hi

    Is the socket actually there ? Please post the output of...

    Code:
    ls -l /var/run/mysqld/mysqld.sock
    It may be an idea to post the config file as well.

    Code:
    cat /etc/mysql/my.cnf
    Kind regards
    Last edited by matt_symes; March 16th, 2013 at 02:09 AM.
    If you believe everything you read, you better not read. ~ Japanese Proverb

    If you don't read the newspaper, you're uninformed. If you read the newspaper, you're mis-informed. - Mark Twain

  3. #3
    Join Date
    Apr 2012
    Beans
    5,920

    Re: unable to connect to mysql

    fyi that's exactly the error I get when the mysql server isn't running:
    Code:
    $ sudo service mysql stop
    mysql stop/waiting
    $
    $ mysql -uroot -p
    Enter password:
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •