{"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"],"_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}]}}