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 server down every so often

Discussion in 'General Discussion' started by yuminanako, Dec 15, 2009.

  1. yuminanako

    yuminanako Member

    Joined:
    Jul 12, 2009
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Hi all,

    MySQL server have been down every so often without any notice.

    Currently I have an ongoing bruteforce attempt at about a few login attempts per second hammering on cphulkd. I was wondering if this could bring down my MySQL server service.

    Also theres no error logs of any whatsoever. So I just enabled error_log in /etc/my.cnf, will post back once I have them.

    Have also optimized the /etc/my.cnf for my server specifications.

    Hmm, so what other reasons do you guys think would cause my MySQL service to suddenly die?
    Any help would be appreciated, thanks.
     
  2. madaboutlinux

    madaboutlinux Well-Known Member

    Joined:
    Jan 24, 2005
    Messages:
    1,052
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    Earth
    By default mysql logs are saved under /var/lib/mysql directory.

    And it could be a bad table that is causing Mysql to fail. If you just have a few databases, try to repair them and see if the problem continues.
     
  3. yuminanako

    yuminanako Member

    Joined:
    Jul 12, 2009
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Hi madaboutlinux, thanks for the reply. Just tried as you say and did a
    mysqlcheck -u root -p --auto-repair --check --optimize --all-databases

    Will post back if MySQL dies again. Thankies.
     
  4. yuminanako

    yuminanako Member

    Joined:
    Jul 12, 2009
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Hmm.. MySQL died again.. My client says that MySQL dies only after logging into Wordpress, everything is fine before Wordpress login.

    Heck, I even tried hammering the site with Apache Bench (ab) with about 1,000 connections. MySQL was still running fine.

    After logging into Wordpress, MySQL just gives up and dies and requires a restart of MySQL service.

    Looked inside log files in /var/lib/mysql and theres no error logs or whatsoever.

    Any help would be appreciated, thanks.
     
  5. madaboutlinux

    madaboutlinux Well-Known Member

    Joined:
    Jan 24, 2005
    Messages:
    1,052
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    Earth
    What version of PHP are you running and are you using mysql_pconnect() in your statements?

    If you are using PHP 5.3 downgrade it to PHP 5.2.x and also change the mysql_pconnect() statements to mysql_connect().

    Also try increasing "wait_timeout" in /etc/my.cnf to 28800 (mine is set to it) and restart Mysql.
     
  6. yuminanako

    yuminanako Member

    Joined:
    Jul 12, 2009
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Hi madaboutlinux,

    Did as you said and changed the mysql_pconnect() to mysql_connect() and also did add the wait_timeout variable to the MySQL configuration and restarted it. So far everything is fine for now and no crashes yet.

    Will report back here if something happens. Thankies for the help by the way. ^^
     
Loading...

Share This Page