The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

MySQL Errors :(

Discussion in 'General Discussion' started by Cubie, Jun 20, 2003.

  1. Cubie

    Cubie Member

    Joined:
    Jun 19, 2003
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Hello,

    My hosting company has just setup WHM for me and I'm getting errors every where:

    ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

    What can i do to fix it?

    cPanel.net Support Ticket Number:
     
  2. pguy

    pguy Well-Known Member

    Joined:
    Feb 21, 2003
    Messages:
    73
    Likes Received:
    0
    Trophy Points:
    6
    Try

    ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock

    Regards,

    cPanel.net Support Ticket Number:
     
  3. Cubie

    Cubie Member

    Joined:
    Jun 19, 2003
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    Thanks for your reply. I tried that and it didn't work. :(

    I have also tried reebooting the server (gently) and now I think I've broken it because it been off line for over 30Mins.

    LMFAO!!

    I upgraded to Cpanel this morning with OnSmart.com and I've left a ticket in their capable hands....


    .... I'mm off to the pub for some much needed liquid relief!!

    Thanks again!! :)

    cPanel.net Support Ticket Number:
     
  4. pguy

    pguy Well-Known Member

    Joined:
    Feb 21, 2003
    Messages:
    73
    Likes Received:
    0
    Trophy Points:
    6
    I hope your DC gets the server on real quick... Mostly such issues get sorted out with a reboot, but the next time you reboot the server, just insure that a support technician from your DC is around.

    This way if anything goes down, you can get it back up real quick.

    Regards,

    cPanel.net Support Ticket Number:
     
  5. nitromax

    nitromax Well-Known Member

    Joined:
    Feb 12, 2002
    Messages:
    189
    Likes Received:
    0
    Trophy Points:
    16
    I had been running MySQL 4 for over a month with no problems. Then I updated to WHM 7.1.0 cPanel 7.1.0-R20. Still no problems at this point. Then I updated /scripts/easyapache to the July 1st build. At that point MySQL gave me the following error:

    Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)


    Then after trying some of the suggestions the error changed to this:

    Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)


    I followed the directions in all of the related posts and nothing seemed to work for me. So here is what I did to finally make it work:

    I read a post at the RackShack forum that the following needed to be in the /etc/my.cnf file:

    [mysqld]
    set-variable = max_connections=500

    [client]
    port = 3306
    socket = /tmp/mysql.sock
    [mysqld]
    port = 3306
    socket = /tmp/mysql.sock


    I only had the first 2 lines, so I added the [client] and [mysqld] parts.


    Then I shut down mysql and chkservd with the following commands:

    service mysql stop
    /etc/rc.d/init.d/chkservd stop


    Then I removed the following files:

    rm -rf /tmp/mysql.sock
    rm -rf /var/lib/mysql/mysql.sock


    Now restart mysql and chkservd with the following commands and mysql will create the mysql.sock file in the /tmp directory as oulined in the updated my.cnf file:

    service mysql start
    /etc/rc.d/init.d/chkservd start


    Now create the softlink with this:

    ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock


    There were a couple of variations in that last last command to create the softlink. I guess it depends on where mysql creates the mysql.sock file when it starts. So if you are trouble shooting you might shut down mysql as shown above, then remove the mysql.sock files. Then restart mysql as shown above and see where it creates the mysql.sock file. If it creates it in the /tmp directory then you need the softlink command shown above. If it creates the mysql.sock file in the /var/lib/mysql directory then you problaby need to use the softlink command like this as shown in some of the other related posts:

    ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock


    That worked for me. Hope this helps someone down the line.

    cPanel.net Support Ticket Number:
     
  6. ciphervendor

    ciphervendor Well-Known Member

    Joined:
    Aug 26, 2002
    Messages:
    1,052
    Likes Received:
    0
    Trophy Points:
    36
    Shit dude, there's no need to post your damn ramble in 10 threads.
     
  7. FWC

    FWC Well-Known Member

    Joined:
    May 13, 2002
    Messages:
    354
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Ontario, Canada
    It was quite the spam job. :eek:
     
  8. nitromax

    nitromax Well-Known Member

    Joined:
    Feb 12, 2002
    Messages:
    189
    Likes Received:
    0
    Trophy Points:
    16
    Excuse me you jerkoff... just trying to be helpful.

    P.S... Thanks for quoting my entire "damn ramble" again!

    cPanel.net Support Ticket Number:
     
  9. ciphervendor

    ciphervendor Well-Known Member

    Joined:
    Aug 26, 2002
    Messages:
    1,052
    Likes Received:
    0
    Trophy Points:
    36
    If you were clear & concise your posts might be bearable. However you visibly demonstrated that you have no idea what you're doing and simply issued commands until your box was magically fixed.

    If you want to help, keep your half assed attempts to fix things to yourself. People like you should not be 'operating' web hosting companies.

    cPanel.net Support Ticket Number:
     
  10. KualoCraig

    KualoCraig Member
    PartnerNOC

    Joined:
    Oct 22, 2002
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    Is there any need for that? These forums are here to help people, and if you have arguments, take them elsewhere rather than stooping so low as to argue on a public forum. The nature of support forums is that if people have a problem, they ask for help. Other people respond with solutions that they have found to work. Not all are going to be correct, but to be honest, it's nice to see a post on this forum that someone has taken the time to respond to. Admittedly, posting in so many threads is unnecessary, but public flamings do not help the matter. I'd like to think that NitroMax will learn gradually, and also be able to help others more in the future. I imagine that you had to start learning somewhere too.

    Please, lets keep it friendly and supportive.

    Best regards,

    Craig.

    cPanel.net Support Ticket Number:
     
  11. khoonchee

    khoonchee Well-Known Member
    PartnerNOC

    Joined:
    Oct 2, 2002
    Messages:
    134
    Likes Received:
    0
    Trophy Points:
    16
    Hi nitromax ,

    Thanks for the tip.I met a similiar case just now and I solved it by using your steps !!!

    Thanks !!!:D

    cPanel.net Support Ticket Number:
     
  12. Jmeier

    Jmeier Registered

    Joined:
    Jun 30, 2003
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Glad to see this place has at least 1 asshole.

    cPanel.net Support Ticket Number:
     
  13. tAzMaNiAc

    tAzMaNiAc Well-Known Member

    Joined:
    Feb 16, 2003
    Messages:
    559
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Sachse, TX
    Well, you obviously didn't read ciphervendor's frustration. He's tired of people who have no obvious experience with unix/linux in general. So AM I! He has been pretty helpful up till this point, so I wonder what happened. Hmm.

    But we're not the jerks here.. people like sexy_guy are more of a real life jerk than we are.. We do help most of the time but when the line is reached, we blow out.. After all, we're human.. right?

    Brenden

    cPanel.net Support Ticket Number:
     
  14. Jmeier

    Jmeier Registered

    Joined:
    Jun 30, 2003
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    I can somewhat understand your point.

    It's just looks not so friendly as this was the 1st post that I opened :)

    On a side note, I had the same problem and wound up reinstalling everything.. Thank God I didn't have any accounts on the server yet.

    cPanel.net Support Ticket Number:
     
  15. Roberto

    Roberto Active Member

    Joined:
    Jul 9, 2003
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    nitromax,

    thank you for your post. Although your post was a bit flaky it helped me greatly today when I needed to get mysql service back online for one of my servers. Here are the lines I entered for future reference if anyone needs to find out how to solve these errors:

    971 service mysql stop
    972 /etc/rc.d/init.d/chkservd stop
    973 locate mysql.sock
    974 rm -rf /var/lib/mysql/mysql.sock
    975 rm -rf /usr/local/lib/mysql.sock
    976 service mysql start
    977 /etc/rc.d/init.d/chkservd start
    978 locate mysql.sock
    979 ln -s /var/lib/mysql/mysql.sock /var/tmp/mysql.sock
    980 w
    981 exit

    Those are the lines I entered to solve the problem. Thanks again to nitromax. This thread was much help to me and I hope it is to everyone else who needs help with this error.

    cPanel.net Support Ticket Number:
     
  16. admin0

    admin0 Active Member

    Joined:
    Aug 11, 2002
    Messages:
    29
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    In almost 3 servers that I monitor, that problem comes after every reboot. On a detail troubleshooting, I found out that the mysql.sock of /var/tmp gets cleared after every reboot [don't know how], and at restart, php gives out error.

    I added the following lines in rc.local
    so that it gets executed at every startup:

    ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock

    ln -s /var/lib/mysql/mysql.sock /var/tmp/mysql.sock



    The above 2 lines will, create the necessary files if missing..

    cPanel.net Support Ticket Number:
     
  17. Roberto

    Roberto Active Member

    Joined:
    Jul 9, 2003
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    Great idea Admin0! :)

    cPanel.net Support Ticket Number:
     
  18. goodmove

    goodmove Well-Known Member

    Joined:
    May 12, 2003
    Messages:
    624
    Likes Received:
    0
    Trophy Points:
    16
    There was nothing wrong with nitromax's post. He put in some interesting information which will no doubt be useful to many Cpanel users.

    Take your hands off nitromax! ;)
     
  19. larrc

    larrc Registered

    Joined:
    Jul 27, 2003
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    MySQL and php errors

    I realize that this is a user group for Cpanel, and I want to learn to use the tools within it. I have just registered a hosting plan with Ace-host.net who use cPanel, they seem to be spewing MySQL and php errors. Being a new hosting customer, I don't know what to make of this, It's been one day and I'm getting lots of trouble. Any thoughts ? I apologize if this is out of place .

    cPanel.net Support Ticket Number:
     
  20. Roberto

    Roberto Active Member

    Joined:
    Jul 9, 2003
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    If the host can't manage the servers properly then it is probably time to move to a new host. Some good hosts are SplashHost, HTTPMe, Darthorn, AcuNett and ECP Hosting.

    cPanel.net Support Ticket Number:
     
Loading...

Share This Page