Find the answer to your Linux question:
Results 1 to 4 of 4
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    MySQL error 2002

    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?


  2. #2
    Linux Guru
    Join Date
    Apr 2003
    London, UK
    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

    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
  5. #4

    MySQL Error


    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.


Posting Permissions

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