Find the answer to your Linux question:
Results 1 to 4 of 4
Hi, Whenever I try to run mysql (by typing 'mysql' into Konsole) it gives me the following error: ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2005
    Posts
    54

    MySQL error 2002


    Hi,
    Whenever I try to run mysql (by typing 'mysql' into Konsole) it gives me the following error:
    ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
    I have tried running it on both my user account and root and also like 'mysql -u root -p' where it asks me for a password, and i type in my root password but it still gives the same error.
    I have seen many other topics about this same error on other forums aswell as this forum but none seem to have helped.
    Whats wrong?

    SFTR!!!

  2. #2
    Linux Guru
    Join Date
    Apr 2003
    Location
    London, UK
    Posts
    3,284
    Is the mysql server started?

    I think you have to run either safe_mysqld --user=mysql OR mysqld_safe --user=mysql (can't remember which) to start it.

    use ps aux | grep mysql to check the server started successfully.

  3. #3
    Just Joined!
    Join Date
    Apr 2005
    Posts
    54

    ok then...

    [root@localhost sftr]# mysqld_safe --user=mysql
    Starting mysqld daemon with databases from /var/lib/mysql
    That worked great THANKS!

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Apr 2005
    Posts
    88

    MySQL Error

    Greetings,

    As far as I know the above mentioned command will start the mysql in the safe mode. You can try to touch the file mysql.sock and then try to run the mysql in a normal mode. Then check if you still face any issues.

    Regards

Posting Permissions

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