FedoraForum.org - Fedora Support Forums and Community
Results 1 to 7 of 7
  1. #1
    Monyet Guest

    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysq

    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
    I checked mysql folder, and there's nothing there.. I just installed LAMPP, it says that the status of mysql is running, but I'm not sure on how can I access mysql from the command line..? thx all

  2. #2
    RippleFX Guest
    I use the same configuration that you are attempting. Here is how I set it up.

    su
    mkdir /var/lib/mysql
    cd /var/lib/mysql
    ln -s /opt/lampp/var/mysql/mysql.sock

    This will allow you to use tools such as mysql-query-browser without any hassles.

    To access mysql from the command line:

    /opt/lampp/bin/mysql

    Alternatively you can create a link in /usr/bin like so

    su
    cd /usr/bin
    ln -s /opt/lampp/bin/mysql

    This will allow you to simply call

    mysql

    from now on.

  3. #3
    Join Date
    Oct 2007
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am getting the following error when I try and start MySql.

    Code:
    [root@localhost /tmp Sat Dec 01]#mysql
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)
    Can anyone help explain what is going on? I'm pretty new to both MySQL and Fedora and this is getting frustrating. Thanks.

  4. #4
    RippleFX Guest
    I would be able to help you if I knew more about your set up. Do you have MySQL installed through the package manager or through XAMPP. If you are using XAMPP from apachefriends.org, ensure that the program is running then you can simply follow these steps:

    su
    mkdir /var/lib/mysql
    cd /var/lib/mysql
    ln -s /opt/lampp/var/mysql/mysql.sock

    If you are using the MySQL from the package manager ensure that it is started as a service:

    su
    service mysql start

    Then try it again.

    Let me know how that turns out for you.

  5. #5
    Join Date
    Oct 2007
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by RippleFX
    I would be able to help you if I knew more about your set up. Do you have MySQL installed through the package manager or through XAMPP. If you are using XAMPP from apachefriends.org, ensure that the program is running then you can simply follow these steps:

    su
    mkdir /var/lib/mysql
    cd /var/lib/mysql
    ln -s /opt/lampp/var/mysql/mysql.sock

    If you are using the MySQL from the package manager ensure that it is started as a service:

    su
    service mysql start

    Then try it again.

    Let me know how that turns out for you.
    I downloaded the package from the MySQL website. Both the server and the client packages.

    When I run "service mysql start" I get a reply that "bash service:command not found".

    I believe that my system does attempt to start up the service, but it gives me a failed reply.

  6. #6
    RippleFX Guest
    try this:

    su -
    service mysql start

    the extra dash after su enables all the commands in /sbin, one of which is 'service'.

    Also, if you prefer GUI, in GNOME you can do System>Administration>Services scroll down and select mysql and hit the start button. If you want mysql to start automatically every time you start your computer, just make sure the box next to the service name is checked.

    Finally, if that doesn't work for you I might suggest uninstalling mysql and reinstalling using yum or pirut and trying it again.

  7. #7
    Join Date
    Jun 2011
    Location
    denpasar-bali (indonesia)
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/

    thnks brother succes

Similar Threads

  1. can't connect to local MySQL server...
    By birv2 in forum Using Fedora
    Replies: 4
    Last Post: 3rd April 2006, 01:40 PM
  2. MySQL-server-4.1.10a-0 ERROR 2002 (HY000) Start up problem
    By DoorGunner in forum Servers & Networking
    Replies: 3
    Last Post: 7th April 2005, 07:13 PM
  3. Can't connect to local MySQL server through socket
    By cyanid3 in forum Servers & Networking
    Replies: 1
    Last Post: 30th January 2005, 06:55 AM
  4. Can't connect to local MySQL server
    By wprauchholz in forum Servers & Networking
    Replies: 20
    Last Post: 6th December 2004, 04:13 AM
  5. MySQL 2002 error
    By fragpot in forum Using Fedora
    Replies: 0
    Last Post: 27th October 2004, 05:29 AM

Tags for this Thread

Posting Permissions

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