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 Modsecparse.pl Can't Connect

Discussion in 'Database Discussions' started by Scott Forward, Aug 14, 2014.

  1. Scott Forward

    Scott Forward Member

    Joined:
    Jul 31, 2014
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Mistassini Post, Quebec, Canada
    cPanel Access Level:
    Reseller Owner
    I'm getting the following message on my server, only thing I can think of is a resize of my VPS, but I wouldn't have figured that would have changed this. The message is coming off a cron, so I'm getting it every hour:

    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. 
    I checked the DB out in PHPmyadmin and found the following:

    Code:
    modsec	localhost	database-specific	SELECT,INSERT,UPDATE,DELETE	No	
    root	127.0.0.1	global	ALL PRIVILEGES	Yes	
    root	::1	        global	ALL PRIVILEGES	Yes	
    root	li-xxx-xx	global	ALL PRIVILEGES	Yes	
    root	localhost	global	ALL PRIVILEGES	Yes	
    
    Any advice would be most appreciated, I tried logging in via SSH to access the DB and received the following error:

    Code:
    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 
     
  2. Scott Forward

    Scott Forward Member

    Joined:
    Jul 31, 2014
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Mistassini Post, Quebec, Canada
    cPanel Access Level:
    Reseller Owner
    This was perfect, cleared up the issue right away. Out of curiosity, will the symbolic link have to be created every time MYSQL restarts or does this establish this link on a permanent basis?
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  4. Scott Forward

    Scott Forward Member

    Joined:
    Jul 31, 2014
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Mistassini Post, Quebec, Canada
    cPanel Access Level:
    Reseller Owner
    Okay, I'll make sure to give it a try. Out of curiosity, you wouldn't happen to know anything about this?

    Code:
     
    Time:   Thu Aug 14 19:17:28 2014 +0000
    File:   /tmp/mysql.sock
    Reason: Suspicious symlink (->/var/lib/mysql/mysql.sock)
    Owner:  ownerex:ownerex (500:500)
    Action: No action taken
    
    I assume it is a result of my earlier modification, do you know how to add an exception to lfd to not worry about this particular file? I assume that there's nothing malicious here.
     
Loading...

Share This Page