mysql.sock error-->should have been mysql sucks

Discussion in 'MySQL' started by protocol96, Mar 29, 2007.

  1. #1
    after install mysql i restarted my pc and tried to started mysql
    i got the errors as Can't connect to local MySQL server through socket '/tmp/mysql.sock'
    so i googled and this url http://www.tech-recipes.com/mysql_tips762.html
    now it give me the error, Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'

    now i dunno wat to do:mad: :mad:

    Like alwayz your help is highly appreciated.
     
    protocol96, Mar 29, 2007 IP
  2. saidev

    saidev Well-Known Member

    Messages:
    328
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    140
    #2
    I assume you are running some sort of *nix based system if the error is complaining about /var/lib/

    check /etc/my.cnf if you have one, if not, I believe mysql.sock default location is at /tmp/mysql.sock.

    If you find the location of it, you can set your client or whatever program it is trying to read that location.

    You'll also need to make sure that mysql is running, do a nmap on your local host and check to see if mysql port is enabled.

    If you can't figure out how to modify your connection client to read mysql.sock somewhere else, try a softlink. (ie #ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock).

    hope this help
     
    saidev, Mar 29, 2007 IP
  3. protocol96

    protocol96 Peon

    Messages:
    413
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #3
    no matter wat i try it keep giving me the same error.
     
    protocol96, Mar 29, 2007 IP
  4. lslars31

    lslars31 Peon

    Messages:
    260
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    OOFTA, I was having some big problems with this when I tried to instal MySQL on my computer. I finally decided to go with a program that automatically installed the whole package for me. I suggest that you try PHPTriad. It installs your server environment, php, and mysql with one click. It's free, and it's kinda nice. :D
     
    lslars31, Mar 29, 2007 IP
  5. prilep

    prilep Well-Known Member

    Messages:
    3,852
    Likes Received:
    228
    Best Answers:
    0
    Trophy Points:
    185
    #5
    I used to have that error on one of my sites, but it was because my sites SQL was down and it got fixed pretty fast.

    - Prilep :D
     
    prilep, Mar 29, 2007 IP
  6. protocol96

    protocol96 Peon

    Messages:
    413
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #6
    when i type the command: bin/mysqld_safe --user=mysql &
    and then try to start it, it starts working, can somebody throw some light on the above statement.
     
    protocol96, Mar 30, 2007 IP
  7. Outstrip

    Outstrip Peon

    Messages:
    182
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #7
    There is a known mysql bug where mysqld_safe starts automatically rather then starting mysql.
    http://bugs.mysql.com/bug.php?id=7249

    What version of mysql are you using?
     
    Outstrip, Mar 30, 2007 IP
    protocol96 likes this.
  8. Valve-Hosting

    Valve-Hosting Peon

    Messages:
    1,071
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #8
    If its a local computer use xampp http://www.apachefriends.org/en/xampp-windows.html This installs an entire Lampp set up with loads more stuff, its really handy, it always works too.

    Thats the windows link but it availble for Linux too. I've had the same problem on remote servers, I just get it again and re-install, thats always worked for me.
     
    Valve-Hosting, Mar 30, 2007 IP
  9. Nizen

    Nizen Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    sudo yum install mysql-serverorsudo apt-get install mysql-serverand then the command /etc/init.d/mysqld should fix all the rest of your mysql.sock issues
     
    Nizen, Aug 30, 2011 IP