{"id":1393,"date":"2008-05-31T14:49:27","date_gmt":"2008-05-31T06:49:27","guid":{"rendered":"https:\/\/www.hongkiat.com\/blog\/untitled-3\/"},"modified":"2024-09-10T20:36:50","modified_gmt":"2024-09-10T12:36:50","slug":"wordpress-database-table-error-fix","status":"publish","type":"post","link":"https:\/\/www.hongkiat.com\/blog\/wordpress-database-table-error-fix\/","title":{"rendered":"Fixing the Unexpected WordPress Database Table Error"},"content":{"rendered":"<p>Recently, a particular table in the WordPress database for <a href=\"https:\/\/www.hongkiat.com\">hongkiat.com<\/a> became corrupted without any warning. The <code>wp_comments<\/code> table crashed unexpectedly, leaving me in search of solutions. Here are the symptoms I encountered:<\/p>\n<ul>\n<li>When attempting to back up your database, you may receive the error message: <code>wp_comments<\/code> is marked as crashed and should be repaired when using <em>LOCK TABLES<\/em>.<\/li>\n<li>The recent comments widget displays blank.<\/li>\n<li>The top commenter widget is also blank.<\/li>\n<li>Comments posted are not saved in the database and therefore are not visible.<\/li>\n<li>The comments section in WP Admin shows zero records.<\/li>\n<\/ul>\n<p>After extensive searching online for similar cases to help identify and resolve the issue, I found nothing helpful. I decided to troubleshoot it myself and, fortunately, I found a solution. I hope that by documenting this process, I can assist others facing the same problem and serve as a reminder for myself should I encounter this error again in the future.<\/p>\n<h2>Solution to Fix the Issue<\/h2>\n<p>To resolve this issue, you need access to the WordPress database via either PhpMyAdmin or Secure Shell (SSH). Most shared hosting accounts include phpMyAdmin, but regardless of the method you choose, be extremely careful when dealing with the database. Any incorrect action may lead to data loss.<\/p>\n<h3>Using PhpMyAdmin<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/phpmyadmin-fix.jpg\" width=\"398\" height=\"188\" alt=\"Repairing wp_comments table using PhpMyAdmin\"><\/p>\n<p>In PhpMyAdmin, select the WordPress database and locate the error table, in this case, the <em>wp_comments<\/em> table. Check the box next to it, scroll down, and find the <strong>With selected<\/strong> drop-down menu. Select <strong>Repair table<\/strong>, and the issue should be resolved.<\/p>\n<h3>Using Secure Shell (SSH)<\/h3>\n<figure>\n    <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/shell-fix.jpg\" width=\"480\" height=\"230\" alt=\"Using SSH to repair the WordPress database\">\n<\/figure>\n<ol>\n<li>Log in to your shell.<\/li>\n<li>Enter <code>mysql -u <em>username<\/em> -p <em>database_name<\/em><\/code> to access your databases.<\/li>\n<li>Enter <code>show databases;<\/code> to view all databases.<\/li>\n<li>Enter <code>use database_name;<\/code> to select the database.<\/li>\n<li>Enter <code>show tables;<\/code> to list all tables in the database.<\/li>\n<li>Enter <code>check table wp_comments;<\/code> to verify if this is the corrupted table.<\/li>\n<li>Repair it using <code>repair table wp_comments;<\/code>.<\/li>\n<li>Finally, enter <code>check table wp_comments;<\/code> again to ensure it is fixed.<\/li>\n<\/ol>\n<p>Steps 3 and 5 can be skipped if you are already familiar with your databases and tables. I hope this guide proves helpful!<\/p>","protected":false},"excerpt":{"rendered":"<p>Recently, a particular table in the WordPress database for hongkiat.com became corrupted without any warning. The wp_comments table crashed unexpectedly, leaving me in search of solutions. Here are the symptoms I encountered: When attempting to back up your database, you may receive the error message: wp_comments is marked as crashed and should be repaired when&hellip;<\/p>\n","protected":false},"author":140,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[49],"tags":[4663,216,252],"topic":[4520],"class_list":["entry-content","is-maxi"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v22.8 (Yoast SEO v27.6) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Fixing the Unexpected WordPress Database Table Error - Hongkiat<\/title>\n<meta name=\"description\" content=\"Recently, a particular table in the WordPress database for hongkiat.com became corrupted without any warning. The wp_comments table crashed unexpectedly,\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.hongkiat.com\/blog\/wordpress-database-table-error-fix\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Fixing the Unexpected WordPress Database Table Error\" \/>\n<meta property=\"og:description\" content=\"Recently, a particular table in the WordPress database for hongkiat.com became corrupted without any warning. The wp_comments table crashed unexpectedly,\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hongkiat.com\/blog\/wordpress-database-table-error-fix\/\" \/>\n<meta property=\"og:site_name\" content=\"Hongkiat\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/hongkiatcom\" \/>\n<meta property=\"article:published_time\" content=\"2008-05-31T06:49:27+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-09-10T12:36:50+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/assets.hongkiat.com\/uploads\/phpmyadmin-fix.jpg\" \/>\n<meta name=\"author\" content=\"Alfredo K\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:site\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Alfredo K\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wordpress-database-table-error-fix\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wordpress-database-table-error-fix\\\/\"},\"author\":{\"name\":\"Alfredo K\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/b7b5c2018f96391a3d260970e9c202d9\"},\"headline\":\"Fixing the Unexpected WordPress Database Table Error\",\"datePublished\":\"2008-05-31T06:49:27+00:00\",\"dateModified\":\"2024-09-10T12:36:50+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wordpress-database-table-error-fix\\\/\"},\"wordCount\":329,\"commentCount\":7,\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wordpress-database-table-error-fix\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/phpmyadmin-fix.jpg\",\"keywords\":[\"ad-divi\",\"wordpress errors\",\"WordPress Tips\"],\"articleSection\":[\"WordPress\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wordpress-database-table-error-fix\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wordpress-database-table-error-fix\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wordpress-database-table-error-fix\\\/\",\"name\":\"Fixing the Unexpected WordPress Database Table Error - Hongkiat\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wordpress-database-table-error-fix\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wordpress-database-table-error-fix\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/phpmyadmin-fix.jpg\",\"datePublished\":\"2008-05-31T06:49:27+00:00\",\"dateModified\":\"2024-09-10T12:36:50+00:00\",\"description\":\"Recently, a particular table in the WordPress database for hongkiat.com became corrupted without any warning. The wp_comments table crashed unexpectedly,\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wordpress-database-table-error-fix\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wordpress-database-table-error-fix\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wordpress-database-table-error-fix\\\/#primaryimage\",\"url\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/phpmyadmin-fix.jpg\",\"contentUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/phpmyadmin-fix.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wordpress-database-table-error-fix\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Fixing the Unexpected WordPress Database Table Error\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"name\":\"Hongkiat\",\"description\":\"Tech and Design Tips\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\",\"name\":\"Hongkiat.com\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"contentUrl\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"width\":1200,\"height\":799,\"caption\":\"Hongkiat.com\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/hongkiatcom\",\"https:\\\/\\\/x.com\\\/hongkiat\",\"https:\\\/\\\/www.pinterest.com\\\/hongkiat\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/b7b5c2018f96391a3d260970e9c202d9\",\"name\":\"Alfredo K\",\"description\":\"Alfredo is an editor for Hongkiat.com. He believes in working hard and playing hard and hopes to publish his travel guide for food lovers one day.\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/author\\\/alfredo_k\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Fixing the Unexpected WordPress Database Table Error - Hongkiat","description":"Recently, a particular table in the WordPress database for hongkiat.com became corrupted without any warning. The wp_comments table crashed unexpectedly,","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.hongkiat.com\/blog\/wordpress-database-table-error-fix\/","og_locale":"en_US","og_type":"article","og_title":"Fixing the Unexpected WordPress Database Table Error","og_description":"Recently, a particular table in the WordPress database for hongkiat.com became corrupted without any warning. The wp_comments table crashed unexpectedly,","og_url":"https:\/\/www.hongkiat.com\/blog\/wordpress-database-table-error-fix\/","og_site_name":"Hongkiat","article_publisher":"https:\/\/www.facebook.com\/hongkiatcom","article_published_time":"2008-05-31T06:49:27+00:00","article_modified_time":"2024-09-10T12:36:50+00:00","og_image":[{"url":"https:\/\/assets.hongkiat.com\/uploads\/phpmyadmin-fix.jpg","type":"","width":"","height":""}],"author":"Alfredo K","twitter_card":"summary_large_image","twitter_creator":"@hongkiat","twitter_site":"@hongkiat","twitter_misc":{"Written by":"Alfredo K","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.hongkiat.com\/blog\/wordpress-database-table-error-fix\/#article","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/wordpress-database-table-error-fix\/"},"author":{"name":"Alfredo K","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/b7b5c2018f96391a3d260970e9c202d9"},"headline":"Fixing the Unexpected WordPress Database Table Error","datePublished":"2008-05-31T06:49:27+00:00","dateModified":"2024-09-10T12:36:50+00:00","mainEntityOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/wordpress-database-table-error-fix\/"},"wordCount":329,"commentCount":7,"publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/wordpress-database-table-error-fix\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/phpmyadmin-fix.jpg","keywords":["ad-divi","wordpress errors","WordPress Tips"],"articleSection":["WordPress"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.hongkiat.com\/blog\/wordpress-database-table-error-fix\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.hongkiat.com\/blog\/wordpress-database-table-error-fix\/","url":"https:\/\/www.hongkiat.com\/blog\/wordpress-database-table-error-fix\/","name":"Fixing the Unexpected WordPress Database Table Error - Hongkiat","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/wordpress-database-table-error-fix\/#primaryimage"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/wordpress-database-table-error-fix\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/phpmyadmin-fix.jpg","datePublished":"2008-05-31T06:49:27+00:00","dateModified":"2024-09-10T12:36:50+00:00","description":"Recently, a particular table in the WordPress database for hongkiat.com became corrupted without any warning. The wp_comments table crashed unexpectedly,","breadcrumb":{"@id":"https:\/\/www.hongkiat.com\/blog\/wordpress-database-table-error-fix\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hongkiat.com\/blog\/wordpress-database-table-error-fix\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/wordpress-database-table-error-fix\/#primaryimage","url":"https:\/\/assets.hongkiat.com\/uploads\/phpmyadmin-fix.jpg","contentUrl":"https:\/\/assets.hongkiat.com\/uploads\/phpmyadmin-fix.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.hongkiat.com\/blog\/wordpress-database-table-error-fix\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.hongkiat.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Fixing the Unexpected WordPress Database Table Error"}]},{"@type":"WebSite","@id":"https:\/\/www.hongkiat.com\/blog\/#website","url":"https:\/\/www.hongkiat.com\/blog\/","name":"Hongkiat","description":"Tech and Design Tips","publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.hongkiat.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.hongkiat.com\/blog\/#organization","name":"Hongkiat.com","url":"https:\/\/www.hongkiat.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","contentUrl":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","width":1200,"height":799,"caption":"Hongkiat.com"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/hongkiatcom","https:\/\/x.com\/hongkiat","https:\/\/www.pinterest.com\/hongkiat\/"]},{"@type":"Person","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/b7b5c2018f96391a3d260970e9c202d9","name":"Alfredo K","description":"Alfredo is an editor for Hongkiat.com. He believes in working hard and playing hard and hopes to publish his travel guide for food lovers one day.","url":"https:\/\/www.hongkiat.com\/blog\/author\/alfredo_k\/"}]}},"jetpack_featured_media_url":"https:\/\/","jetpack_shortlink":"https:\/\/wp.me\/p4uxU-mt","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/1393","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/users\/140"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/comments?post=1393"}],"version-history":[{"count":3,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/1393\/revisions"}],"predecessor-version":[{"id":72846,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/1393\/revisions\/72846"}],"wp:attachment":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/media?parent=1393"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/categories?post=1393"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/tags?post=1393"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/topic?post=1393"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}