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.

Error establishing database connection issues

Discussion in 'Database Discussions' started by Don McDonald, Oct 29, 2014.

  1. Don McDonald

    Don McDonald Member

    Joined:
    Oct 29, 2014
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Napa, California, United States
    cPanel Access Level:
    Reseller Owner
    This morning I got a error establishing database connection when trying to access one of my WordPress blog sites. After spending hours now researching the issue, things have gotten worse. as early as 5 minutes ago I was able to log on and work on WHM and Cpanel. Now I get a page not found on the browser. What the heck has happened and how to I begin to fix this. It has now effected two other website that now simply show "Page not found" when I try to bring them up? Anyone, please help.
     
  2. Don McDonald

    Don McDonald Member

    Joined:
    Oct 29, 2014
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Napa, California, United States
    cPanel Access Level:
    Reseller Owner
    Okay, I am able to log back into my WHM and Cpanel accounts. perhaps they were just down...??? Still the big question and need help to resolve the issue of the error message "The MySQL server is currently offline." followed by the message below.

    "Error while connecting to MySQL: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2). Error from MySQL query: Can't call method "do" on an undefined value at /usr/local/cpanel/Cpanel/Mysql.pm line 1196, <STDIN> line 1."

    Please help
     
  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
    Hello :)

    Your access level is configured as "Reseller Owner". Do you have root access to this server? If not, please report this issue to your web hosting provider so they can take a closer look.

    Thank you.
     
  4. Don McDonald

    Don McDonald Member

    Joined:
    Oct 29, 2014
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Napa, California, United States
    cPanel Access Level:
    Reseller Owner
    Yes, I have root access, I am the provider/owner/designer/ you name it, it's all me. :) Set up through Hostgator, a WHM account etc
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Check to see if the /tmp/mysql.sock symbolic link exists and look for any error messages in /var/lib/mysql/$hostname.err when restarting MySQL.

    Thank you.
     
  6. Don McDonald

    Don McDonald Member

    Joined:
    Oct 29, 2014
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Napa, California, United States
    cPanel Access Level:
    Reseller Owner
    Okay, I am not real experienced here, how do I do that search etc...

    - - - Updated - - -

    I assuming I had to have been hacked here. While I was researching, my log in did not work for about 15 minutes. Then it allowed me in. The databases are completely gone. It's as though the Cpanel is new and starting from scratch. No files of any sorts. If this is the case, I did not back up my database, I assume it's gone for good? If so, I will need to rebuild the site and start over. Can this be done from the same Cpanel? When I go to see Wordpress installations it gives me a error...
     
  7. Don McDonald

    Don McDonald Member

    Joined:
    Oct 29, 2014
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Napa, California, United States
    cPanel Access Level:
    Reseller Owner
    Okay, I am completely losing it.... Everything is all back up. 4 hours later. WTF??? What happened?
     
  8. whr

    whr Active Member

    Joined:
    Jul 25, 2009
    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    India
    Did you check the error log /var/lib/mysql/$hostname.err as Micheal suggested?

    If it happens again, see if MySQL has crashed.

    Try to start it using the below command:

    /etc/init.d/mysql start ; tail -f /var/lib/mysql/$hostname.err
     
Loading...

Share This Page