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.

Cron: DBI connect failed

Discussion in 'General Discussion' started by DreamPhysix, Oct 23, 2011.

  1. DreamPhysix

    DreamPhysix Well-Known Member

    Joined:
    Sep 30, 2009
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    6
    When cron daemon has been running recently at midnight, I've been sent the following error from cPanel:

    Subject: Cron <root@fourier> /usr/bin/test -x /usr/local/cpanel/scripts/update_db_cache && /usr/local/cpanel/scripts/update_db_cache

    Body: DBI connect('mysql:localhost','root',...) failed: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) at /usr/local/cpanel/scripts/update_db_cache line 59
    Can't call method "prepare" on an undefined value at /usr/local/cpanel/scripts/update_db_cache line 60.

    I searched these forums and got no results, any advice or do I need to open a ticket? Thanks! Also appears the server goes on high load during this time and I had to force a reboot because stuff was running out of memory...
     
    #1 DreamPhysix, Oct 23, 2011
    Last edited: Oct 23, 2011
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Please try running the following command and let us know if you see any error messages:

    Code:
    /scripts/mysqlconnectioncheck
    You are also welcome to open a support ticket and have our staff investigate the cause of the problem. If you choose to do so, please post the ticket number here so we may track the issue.

    Thank you.
     
  3. DreamPhysix

    DreamPhysix Well-Known Member

    Joined:
    Sep 30, 2009
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    6
    I ran it multiple times and had no outputs. I think it was related to the fact that cron daemon was running when my server ran out of memory and processes were being killed. I'm adding 128MB of RAM to my VPS soon
     
    #3 DreamPhysix, Oct 24, 2011
    Last edited: Oct 24, 2011
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    If you don't receive any output, it should mean that it is working.

    Can you please try connecting to MySQL command line in root SSH:

    Code:
    mysql
    If you receive an error upon trying to run that command, then please post the return.

    What might be happening is that 127.0.0.1 has access while localhost does not for root user. You can try the following if that's the case:

    Code:
    cat /root/.my.cnf
    Copy the password listed in that file, then run this command:

    Code:
    mysql -u root -p -h 127.0.0.1
    At the password prompt, enter the password you had copied.

    Now, in mysql command line, run this command:

    Code:
    GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY 'passwordhere' WITH GRANT OPTION;
    FLUSH PRIVILEGES;
    Please replace passwordhere with the password previously copied. Then quit MySQL command line using quit and then try to go back into MySQL command line simply using mysql this time to see if you can connect to localhost all right.
     
  5. DreamPhysix

    DreamPhysix Well-Known Member

    Joined:
    Sep 30, 2009
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    6
    I don't receive any errors and running the MySQL queries you mentioned affected 0 rows.
     
  6. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    At this point in time, it would seem like MySQL really shouldn't be returning that response. Could you please submit a ticket using WHM > Support Center > Contact cPanel or using the link in my signature so we can check into this further? Please post the ticket number here once you've opened one. Thanks!
     
  7. DreamPhysix

    DreamPhysix Well-Known Member

    Joined:
    Sep 30, 2009
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    6
    Ticket ID is 1954129
     
Loading...

Share This Page