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 - broke it sorta -- how can I fix?

Discussion in 'General Discussion' started by myrem, Jun 5, 2005.

  1. myrem

    myrem Well-Known Member

    Jul 14, 2002
    Likes Received:
    Trophy Points:
    Had an issue a couple of months ago where PHP scripts could not connect to mysql.. I stuffed some things to make it work and I know it's not the way it's supposed to run, but it fixed the immedate problem.

    Now, the problem I have is, when a user is in jailshell telnet (works fine in normal shell) and attempts to run mysql command-line tools, they fail with:

    mysqldump: Got error: 2002: Can't connect to local MySQL server through socket
    '/var/lib/mysql/mysql.sock' (2) when trying to connect

    Works fine in a normal shell.

    Assuming it has something to do with the directory/permissions of where the socket file is located. I'd really like to get MySQL running as CP expects it.

    Currently, my.conf has:
    socket = /var/tmp/mysql.sock

    In /tmp, mysql.sock is linked to:
    mysql.sock -> ../var/tmp/mysql.sock

    /var/tmp/mysqlsock is the real socket file.

    How do I need to re-configure to get this all back to what CP expects?

    Any ideas from those smarter than I? :) Thanks in advance!
  2. hicom

    hicom Well-Known Member

    May 23, 2003
    Likes Received:
    Trophy Points:
    mySQL JailShell re-visited

    I'm having the exact same problem on FreeBSD and latest stable cPanel. A user with Jailshell can't access mysql. It returns:

    mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (61) when trying to connect

    However, if I go to /home/virtfs/User/tmp it is there and if I delete it, the whole mySQL server goes down. checked the virtfs/User/etc/ and my.cnf is the exact same settings as the server, so everything is being duplicated fine.

    Any idea why Jailshell is causing this problem ? Thx!

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