{"id":1984,"date":"2021-09-17T12:34:10","date_gmt":"2021-09-17T12:34:10","guid":{"rendered":"https:\/\/ownwebservers.com\/kb\/?p=1984"},"modified":"2021-09-17T13:49:28","modified_gmt":"2021-09-17T13:49:28","slug":"how-to-check-and-repair-a-corrupted-mysql-database-table-using-ssh","status":"publish","type":"post","link":"https:\/\/ownwebservers.com\/kb\/how-to-check-and-repair-a-corrupted-mysql-database-table-using-ssh\/","title":{"rendered":"How to Check and Repair a Corrupted MySQL Database Table using SSH ?"},"content":{"rendered":"<p>Most of the days, because of errors or bugs within the MySQL database tables, webmasters have to face various unknown problems. Whenever a database table gets corrupted, the most important thing you must do is to see the problem behind it. It will be either as a result of the server crash or the database table is gets corrupted. By checking the recent <strong>\/var\/log\/mysql<\/strong>.log you&#8217;ll verify that, what was the exact issue? And if there&#8217;s such message within the log file, in all probability it&#8217;s because of the server dying. Else, it&#8217;s got corrupted as a result of a bug.<\/p>\n<p>In this article, we will go to see the steps using two different commands on How to Check and Repair a Corrupted MySQL Database Table using Secure SHell (SSH) Linux command prompt ?<\/p>\n<p>1) Through Secure SHell (SSH) login to your MySQL server.<\/p>\n<p>2) At the secure shell SSH prompt enter the command as follow:<\/p>\n<blockquote><p><strong>mysqlcheck -r [database name]<\/strong><\/p><\/blockquote>\n<p>Where, to check the database mysqlcheck command is used , to repair the corrupted table -r is the command. The [databasename] should be replaced with your actual database name.<\/p>\n<p><strong>MyISAM<\/strong> may be a default storage engine of MySQL unless you change it. Most of the people uses MyISAM as their default engine to check and repair all the tables within the mysql database.<\/p>\n<p>You can try out the following commands via the linux shell prompt, if the above commands doesn\u2019t work for you.<\/p>\n<blockquote><p><strong>myisamchk -r \/var\/lib\/mysql\/[database name]\/*<\/strong><\/p><\/blockquote>\n<p>Where, to check mysql database <strong>myisamchk<\/strong> command is used and to repair the corrupted tables <strong>-r<\/strong> command is used.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Most of the days, because of errors or bugs within the MySQL database tables, webmasters have to face various unknown problems. Whenever a database table gets corrupted, the most important thing you must do is to see the problem behind it. It will be either as a result of the server crash or the database [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[],"class_list":["post-1984","post","type-post","status-publish","format-standard","hentry","category-mysql"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v15.2.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Check and Repair a Corrupted MySQL Database Table using SSH ? - OWS KB<\/title>\n<meta name=\"description\" content=\"Most of the days, because of errors or bugs within the MySQL database tables, webmasters have to face various unknown problems.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ownwebservers.com\/kb\/how-to-check-and-repair-a-corrupted-mysql-database-table-using-ssh\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Check and Repair a Corrupted MySQL Database Table using SSH ? - OWS KB\" \/>\n<meta property=\"og:description\" content=\"Most of the days, because of errors or bugs within the MySQL database tables, webmasters have to face various unknown problems.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ownwebservers.com\/kb\/how-to-check-and-repair-a-corrupted-mysql-database-table-using-ssh\/\" \/>\n<meta property=\"og:site_name\" content=\"OWS KB\" \/>\n<meta property=\"article:published_time\" content=\"2021-09-17T12:34:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-09-17T13:49:28+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\">\n\t<meta name=\"twitter:data1\" content=\"admin\">\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\">\n\t<meta name=\"twitter:data2\" content=\"1 minute\">\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/#website\",\"url\":\"https:\/\/ownwebservers.com\/kb\/\",\"name\":\"OWS KB\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/ownwebservers.com\/kb\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/how-to-check-and-repair-a-corrupted-mysql-database-table-using-ssh\/#webpage\",\"url\":\"https:\/\/ownwebservers.com\/kb\/how-to-check-and-repair-a-corrupted-mysql-database-table-using-ssh\/\",\"name\":\"How to Check and Repair a Corrupted MySQL Database Table using SSH ? - OWS KB\",\"isPartOf\":{\"@id\":\"https:\/\/ownwebservers.com\/kb\/#website\"},\"datePublished\":\"2021-09-17T12:34:10+00:00\",\"dateModified\":\"2021-09-17T13:49:28+00:00\",\"author\":{\"@id\":\"https:\/\/ownwebservers.com\/kb\/#\/schema\/person\/4a40fe3fe17a08ddd1d7c113668e75f2\"},\"description\":\"Most of the days, because of errors or bugs within the MySQL database tables, webmasters have to face various unknown problems.\",\"breadcrumb\":{\"@id\":\"https:\/\/ownwebservers.com\/kb\/how-to-check-and-repair-a-corrupted-mysql-database-table-using-ssh\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ownwebservers.com\/kb\/how-to-check-and-repair-a-corrupted-mysql-database-table-using-ssh\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/how-to-check-and-repair-a-corrupted-mysql-database-table-using-ssh\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/\",\"url\":\"https:\/\/ownwebservers.com\/kb\/\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"position\":2,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/how-to-check-and-repair-a-corrupted-mysql-database-table-using-ssh\/\",\"url\":\"https:\/\/ownwebservers.com\/kb\/how-to-check-and-repair-a-corrupted-mysql-database-table-using-ssh\/\",\"name\":\"How to Check and Repair a Corrupted MySQL Database Table using SSH ?\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/#\/schema\/person\/4a40fe3fe17a08ddd1d7c113668e75f2\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ba5db5841d48bd7517bb2583e13983e6d2fa56a4099a0b3c61ad2daefc321303?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"sameAs\":[\"https:\/\/ownwebservers.com\/kb\"]}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","_links":{"self":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts\/1984","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/comments?post=1984"}],"version-history":[{"count":1,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts\/1984\/revisions"}],"predecessor-version":[{"id":1985,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts\/1984\/revisions\/1985"}],"wp:attachment":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/media?parent=1984"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/categories?post=1984"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/tags?post=1984"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}