Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

mysql.sock and jailshell

Discussion in 'General Discussion' started by sparek-3, Dec 15, 2004.

  1. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,762
    Likes Received:
    116
    Trophy Points:
    343
    cPanel Access Level:
    Root Administrator
    When trying to access MySQL databases through the shell, using jailshell, we get the error message

    ERROR 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (61)

    There is a mysql.sock file in the /tmp directory and in /home/virtfs/user/tmp .

    The server is running FreeBSD 4.9.
     
  2. jsteel

    jsteel Well-Known Member

    Joined:
    Jul 4, 2002
    Messages:
    646
    Likes Received:
    0
    Trophy Points:
    166
    Location:
    Atlanta, GA
    We're having this same issue on RHEL 3.
     
  3. dezignguy

    dezignguy Well-Known Member

    Joined:
    Sep 26, 2004
    Messages:
    532
    Likes Received:
    0
    Trophy Points:
    166
    you should probably recreate the mysql.sock file in the tmp directories... you can search the forums her eto find out how to do that... basically you make a symbolic link with

    ln -s
     
  4. jsteel

    jsteel Well-Known Member

    Joined:
    Jul 4, 2002
    Messages:
    646
    Likes Received:
    0
    Trophy Points:
    166
    Location:
    Atlanta, GA
    Simply doing 'ln -s /var/lib/mysql/mysql.sock /var/tmp/mysql.sock' will not fix the jailshell from properly having the /var/tmp directory.
     
  5. jsteel

    jsteel Well-Known Member

    Joined:
    Jul 4, 2002
    Messages:
    646
    Likes Received:
    0
    Trophy Points:
    166
    Location:
    Atlanta, GA
    It appears the only way to patch it (since the internals of jailshell do not recognize the /var/tmp directory) is to actually:

    1) Force the creation of the necessary directory (for every jailshell user):

    mkdir /home/virtfs/username/var/tmp

    2) Adjust permissions by:

    chown root:username /home/virtfs/username/var/tmp

    3) Create a symbolic link via:

    ln -s /var/lib/mysql/mysql.sock /home/virtfs/username/var/tmp/mysql.sock

    This of course is a bit of a hack job but does seem to patch the problem. cPanel though should of course fix the jailshell internals to automatically recognize the /var/tmp directory and the subsequent mysql.sock file under it.
     
  6. dezignguy

    dezignguy Well-Known Member

    Joined:
    Sep 26, 2004
    Messages:
    532
    Likes Received:
    0
    Trophy Points:
    166
    Sorry, I missed the jail shell specific part...
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice