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!

[Case 105565] recreate /tmp/mysql.sock on mysql restart

Discussion in 'cPanel Developers' started by simonas, Jun 24, 2014.

  1. simonas

    simonas Well-Known Member

    Joined:
    Apr 21, 2013
    Messages:
    141
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Lithuania
    cPanel Access Level:
    Root Administrator
    Hello everybody,

    With the latest update (Cpanel version: 11.44.0 (build 17)) one of my server's began having problem - system could not connect to the mysql.

    Code:
    Cron <root@host> /usr/bin/test -x /usr/local/cpanel/scripts/update_db_cache && /usr/local/cpanel/scripts/update_db_cache
    
    Error while connecting to MySQL: Cpanel::DBI::Mysql connect('','root',...) failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) at /usr/local/cpanel/Cpanel/Mysql.pm line 140
    Also MODSEC:

    Code:
    /etc/cron.hourly/modsecparse.pl:
    
    DBI connect('modsec:localhost','modsec',...) failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) at /etc/cron.hourly/modsecparse.pl line 20
    Unable to connect to mysql database at /etc/cron.hourly/modsecparse.pl line 20.
    After investigating with the help of Cpanel, we found that
    And openened inquiry (#105565).

    Quick solution would be add to you /etc/my.cnf:
    Or create symlink. Mods, please update this thread. Thanks.
     
    #1 simonas, Jun 24, 2014
    Last edited: Jun 24, 2014
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,423
    Likes Received:
    1,959
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello :)

    Internal case number 105565 is open to inquire if /tmp/mysql.sock should be recreated after MySQL restarts. I will update this thread with more information as it becomes available. In the meantime, manually creating the symbolic link is a valid workaround if it does not exist:

    Code:
    ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock 
    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. jayrex

    jayrex Registered

    Joined:
    Jul 6, 2014
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I believe I have the same type of problem:

    Error while connecting to MySQL: Cpanel::DBI::Mysql connect('','root',...) failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) at /usr/local/cpanel/Cpanel/Mysql.pm line 140 Error while connecting to MySQL: Cpanel::DBI::Mysql connect('','root',...) failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) at /usr/local/cpanel/Cpanel/Mysql.pm line 140 ...caught

    Could someone let me know if this can be fixed?

    I won't be able to fix this myself as I'm not technical, but it looks like an automatic update created this error, will cPanel bring out another update to fix this error?
     
  4. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,423
    Likes Received:
    1,959
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Did you try running the command referenced in my previous post?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
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