Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Member
    Join Date
    Aug 2002
    Posts
    1,120

    Default mysql.sock and jailshell

    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. #2
    Member
    Join Date
    Jul 2002
    Location
    Atlanta, GA
    Posts
    646

    Default

    Quote Originally Posted by sparek-3
    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.
    We're having this same issue on RHEL 3.

  3. #3
    Member
    Join Date
    Sep 2004
    Posts
    529

    Default

    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. #4
    Member
    Join Date
    Jul 2002
    Location
    Atlanta, GA
    Posts
    646

    Default

    Quote Originally Posted by dezignguy
    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
    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. #5
    Member
    Join Date
    Jul 2002
    Location
    Atlanta, GA
    Posts
    646

    Default

    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. #6
    Member
    Join Date
    Sep 2004
    Posts
    529

    Default

    Sorry, I missed the jail shell specific part...

Similar Threads & Tags
Similar threads

  1. Replies: 13
    Last Post: 06-15-2010, 04:31 PM
  2. Replies: 13
    Last Post: 06-15-2010, 04:31 PM
  3. Remote MySQL and /var/lib/mysql/mysql.sock
    By emechanic in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 12-02-2009, 01:08 PM
  4. Can't connect to local MySQL server through socket '/tmp/mysql.sock'
    By kerm1t in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 05-19-2005, 07:39 PM
  5. Replies: 0
    Last Post: 06-27-2004, 02:53 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube