Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2004
    Location
    India
    Posts
    292

    ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.

    Hello all,
    I am having problem in connecting mysql database :
    When I typed mysql -u root at shell prompt: I got the error..
    ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
    I ahve checked for file mysql.sock in mysql directory ..it isn't there..
    I have changed permissions of folder mysql to 777..
    changed owner and grp of all files under mysql folder to mysql...
    I even tried mysqld_safe but didn't work at all...
    Below I am pasting my /etc/my.cnf file for checking...
    [mysqld]
    datadir=/var/lib/mysql
    socket=/var/lib/mysql/mysql.sock

    [mysql.server]
    user=mysql
    basedir=/var/lib

    [safe_mysqld]
    err-log=/var/log/mysqld.log
    pid-file=/var/run/mysqld/mysqld.pid

    Can anybody help me out?

  2. #2
    Greetings:

    I am not sure if this will work now given the modifications you did already.

    But have you tried simply stopping and restaring the mysql service?

    Thank you.
    ---
    Peter M. Abraham
    LinkedIn Profile

  3. #3
    Join Date
    Apr 2004
    Location
    India
    Posts
    292
    yes dynamicnet
    i tried it.
    Strange thing is that there is no restart in /etc/init.d/mysql .
    Ok there is something I didn't tell you about..
    yesterday only I uograded cpanel with /scripts/upcp ..
    and I think since then I got this error..I am very sure but I think it could be because of that or else ?
    when I typed /etc/init.d/mysql stop i got this on my screen..
    safe_mysqld mysqld mysqld_safe mysql
    And then i typed /etc/init.d/mysql start
    nothing happened at all..
    I know musqld isn't running..
    But I am able to trace error..
    Please help dynamicnet
    thank you

  4. #4
    Greetings:

    The forums are limited in terms of how much help can be provided (of note there are several companies that can provide help that participate in WHT --- granted for a fee).

    Check in the mysql source directory for a scripts or support-files area. That should have the "mysql.server" start up script.

    Thank you.
    ---
    Peter M. Abraham
    LinkedIn Profile

  5. #5
    Join Date
    Apr 2004
    Location
    India
    Posts
    292
    Hello,
    Should I restart server now because now eximstats also failed..
    /etc/init.d/exim start
    error:
    exim eximCould not create INET socket: Address already in use IO:ocket::INET: Address already in use
    Please help
    thank you

  6. #6
    Join Date
    Dec 2003
    Location
    Mentor, Ohio
    Posts
    38
    shouldnt it be
    /etc/rc.d/init.d/mysqld ?

    that error usualy happens when mysqld isnt running, type
    ps -aux | grep mysql

    see if its running
    Compaq Linux Forums!
    http://www.cpqforums.com

Posting Permissions

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