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.

Server crash -|- database now unavailable

Discussion in 'General Discussion' started by schwim, Oct 25, 2009.

  1. schwim

    schwim Well-Known Member

    Joined:
    Aug 2, 2006
    Messages:
    198
    Likes Received:
    0
    Trophy Points:
    16
    Hi there guys,

    My server often crashes during ftp backups, I guess due to the size of some of the accounts, and often I have to repair a database table or two to get some sites going again.

    This time however, the database seems to not want to play nice. First, I tried accessing it from phpmyadmin, but the pageload is stalling out. I then shelled in and tried mysqlrepair -r database_name and it cycled through almost all of the database, but it is hanging on a table toward the end.

    I'm not sure what else I can try to do to force the repair of the table. To that end, I'm not quite sure how to access phpmyadmin on that account at all since it's not allowing me to see it due to the corrupt db.

    Help on trying to save the db would be greatly appreciated :)

    thanks,
    json
     
  2. schwim

    schwim Well-Known Member

    Joined:
    Aug 2, 2006
    Messages:
    198
    Likes Received:
    0
    Trophy Points:
    16
    Well, it seems to be locked up tighter than a drum. I've tried all the above as well as repair through WHM, and scripts like such:

    Code:
    <?
    $db_host = "localhost";
    $db_user = "user";
    $db_pass = "pass1234";
    $db_name = "database";
    $connect = @mysql_connect($db_host,$db_user,$db_pass);
    @mysql_select_db($db_name);
    
    // Empty table
    $query = "TRUNCATE TABLE pn_session_info";
    mysql_query($query);
    ?>
    
    and everything stalls out. It seems that each of my efforts stack mysql processes into the running process list:

    Is there a way for me to force the emptying of this table so I can get this particular site back online?

    thanks,
    json
     
  3. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,446
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Not sure if this is any help or not, but:



    Add the stuff in bold and try it again. or, try this suggestion from Mark West back in 2003.

    Can you access the DB from WHM > PHPMyAdmin?

    Meantime, postnuke has been dead for several years now, as has pnPHPBB. Neither should be being used on a live site without expecting problems, like this.
     
  4. schwim

    schwim Well-Known Member

    Joined:
    Aug 2, 2006
    Messages:
    198
    Likes Received:
    0
    Trophy Points:
    16
    Thanks for the reply.

    For clarification, I don't need help connecting to this database. The table is corrupt due to being written to during the crash. I can connect and manipulate all databases but this one, due to the single table that is occupied. All attempts fail do to the table being locked.

    Any help on either emptying or deleting the session table would be greatly appreciated.

    thanks,
    json
     
  5. D-Litz

    D-Litz Active Member

    Joined:
    Feb 4, 2009
    Messages:
    35
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    I had a similar issue with a table and opened a ticket with cPanel to get it fixed...below is what they did via command line...of course I removed actual data, but I think you'll get the idea.


     
Loading...

Share This Page