Results 1 to 2 of 2

Thread: 9.04 / XAMPP / mysql / ERROR2002(HY000)

  1. #1
    Join Date
    Jul 2009
    Beans
    4

    9.04 / XAMPP / mysql / ERROR2002(HY000)

    For information : I had to do this twice (due to reinstalling my machine) so I'm clear on it now!

    I installed XAMPP onto Jaunty 9.04 and it all works fine except if you want to run a mysql command in the terminal. phpMyAdmin works fine, My-SQL Admin GUI tools worked fine, etc, but running mysql I got the following error : ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2). The main problem was that the default install points to a directory that doesn't exist for the file to be created in ... which doesn't stop the process starting, but stops the mysql client connecting.

    I went into it through a range of options but what I ended up with which worked was :
    1) Create a folder /mysql in /opt/lampp/var/ and give access rights (chmod 755).

    2) locate your two copies of my.cnf - one in /etc/mysql and one in /opt/lampp/etc

    3) ensure that there is a file mysql.sock in /opt/lampp/var/mysql - either create a blank file, or the following entries should create it.

    4) in both versions of my.cnf, ensure that the following entries point to /opt/lampp/var/mysql/mysql.sock

    [mysqld]
    port = 3306
    socket = /opt/lampp/var/mysql/mysql.sock

    [client]
    port = 3306
    socket = /opt/lampp/var/mysql/mysql.sock

    I found that I needed to reboot (not just xampp restart), then it worked fine.

    If it helps anyone, good!

    regards
    Ed

  2. #2
    Join Date
    Nov 2010
    Beans
    7

    Re: 9.04 / XAMPP / mysql / ERROR2002(HY000)

    Thanks....
    you rock

Tags for this Thread

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
  •