Support » Fixing WordPress » Database Error after repairing wp_comments in phpmyadmin

  • Resolved kingkio


    I have recently started a blog at Everything was going along smoothly until I noticed that I had 5 comments pending (from myself whilst testing comment threading) however when I click into the comment menu I was told there was no results.

    Searching for a resolution I came across the following resolved thread:

    Within the thread was a a guide on how to repair WP_comments in PHPmyAdmin.

    Following the instructions I logged into my database, ticked the check box against the table wp_comments and selected “Repair Table” from the drop-down box.

    However, since my storage engine does not support repair table I had to do the repair manually through the supplied script.

    DROP TABLE IF EXISTSwp_comments`;
    CREATE TABLE wp_comments (
    comment_ID bigint(20) unsigned NOT NULL auto_increment,
    comment_post_ID int(11) NOT NULL default ‘0’,
    comment_author tinytext NOT NULL,
    comment_author_email varchar(100) NOT NULL default ”,
    comment_author_url varchar(200) NOT NULL default ”,
    comment_author_IP varchar(100) NOT NULL default ”,
    comment_date datetime NOT NULL default ‘0000-00-00 00:00:00’,
    comment_date_gmt datetime NOT NULL default ‘0000-00-00 00:00:00’,
    comment_content text NOT NULL,
    comment_karma int(11) NOT NULL default ‘0’,
    comment_approved varchar(20) NOT NULL default ‘1’,
    comment_agent varchar(255) NOT NULL default ”,
    comment_type varchar(20) NOT NULL default ”,
    comment_parent bigint(20) NOT NULL default ‘0’,
    user_id bigint(20) NOT NULL default ‘0’,
    PRIMARY KEY (comment_ID),
    KEY comment_approved (comment_approved),
    KEY comment_post_ID (comment_post_ID),
    KEY comment_approved_date_gmt (comment_approved,comment_date_gmt),
    KEY comment_date_gmt (comment_date_gmt)

    After “repairing” the table I tried to visit my wordpress dashboard to see if the problem had to be resolved. I got the following error:

    Error establishing a database connection
    This either means that the username and password information in your wp-config.php file is incorrect or we can't contact the database server at This could mean your host's database server is down.
    Are you sure you have the correct username and password?
    Are you sure that you have typed the correct hostname?
    Are you sure that the database server is running?
    If you're unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums.

    going directly to gives me another database error:

    Error establishing a database connection

    I am pretty much a novice/amatuer at everything to do with coding, I usually get through the technical side of my websites by relying on the knowledge and experience of my peers. If anyone can help me troubleshoot then I would be extremely grateful.

Viewing 1 replies (of 1 total)
  • Sigh.

    Amatuer mistake on my part, Since it was my first time logging in to the myphpadmin I didn’t know the password so changed it to something different.

    Updating the password on the wpconfig.php fixed it.

Viewing 1 replies (of 1 total)
  • The topic ‘Database Error after repairing wp_comments in phpmyadmin’ is closed to new replies.