Stellar Logo
  • For Individuals
    Back to main menu

    For Individual

    • Windows Data Recovery

      Recovers lost or deleted Office documents, emails, presentations & multimedia files.

      • Free
      • Standard
      • Professional
      • Premium
    • Mac Data Recovery

      Recovers deleted files, photos, videos etc. on Mac.

      • Free
      • Standard
      • Professional
      • Premium
    • Photo Recovery

      Recover photos, videos, & audio files from all cameras and storage on Windows or Mac.

      • Standard
      • Professional
      • Premium
    • iPhone Data Recovery

      Recover deleted photos, videos, contacts, messages etc. directly from iPhone & iPad.

      • Recover
      • Erase
      • Toolkit
    • Video Repair

      Repair multiple corrupt videos in one go. Supports MP4, MOV & other formats.

      • Standard
      • Premium
    • Photo Repair

      Repair multiple corrupt photos in one go. Supports JPEG & other formats.

      • Standard
      • Professional
      • Premium
  • For Business
    Back to main menu

    For Business

    • Email Repair
      • Exchange Repair Repair corrupt EDB file & export mailboxes to Live Exchange or Office 365
      • Outlook PST Repair Repair corrupt PST & recover all mailbox items including deleted emails & contacts
      • OLM Repair Repair Outlook for Mac (OLM) 2011 & 2016 backup files & recover all mailbox items
      • Exchange Toolkit Repair EDB & Exchange backup file to restore mailboxes, convert OST to PST, & convert EDB to PST
      • Active Directory Repair Repair corrupt Active Directory database (Ntds.dit file) & extract all objects in original form
    • Email Converter
      • EDB to PST Convert online & offline EDB file & extract all mailbox items including Public Folders in PST
      • OST to PST Convert inaccessible OST file & extract all mailbox items including deleted emails in PST
      • NSF to PSTConvert IBM Notes NSF file & export all mailbox items including emails & attachments to PST
      • MBOX to PSTConvert MBOX file of Thunderbird, Entourage & other clients, & export mailbox data to PST
      • OLM to PST Convert Outlook for Mac Data File (OLM) & export all mailbox data to PST in original form
      • GroupWise to PST Convert GroupWise mail & export all mailbox items - emails, attachments, etc. - to PST
      • EML to PSTConvert Windows Live Mail (EML) file & export mailbox data - emails, attachments, etc. - to PST
      • Office 365 to PSTConnect to Office 365 account & export mailbox data to PST and various other formats
      • Migrator for Office 365Quickly migrate Outlook data files(OST/PST) directly to Office 365 or Live Exchange
    • File Repair
      • SQL Repair Repair corrupt .mdf & .ndf files and recover all database components in original form
      • Access RepairRepair corrupt .ACCDB and .MDB files & recover all records & objects in a new database
      • QuickBooks RepairRepair corrupt QuickBooks® data file & recover all file components in original form
      • MySQL RepairRepair MyISAM & InnoDB tables and recover all objects - keys, views, tables, triggers, etc.
      • Excel RepairRepair corrupt Excel (.XLS & .XLSX) files and recover tables, charts, chart sheet, etc.
      • BKF RepairRepair corrupt backup (BKF, ZIP, VHDX and .FD) files and restore complete data
      • Database ConverterInterconvert MS SQL, MySQL, SQLite, and SQL Anywhere database files
      • PowerPoint RepairRepair corrupt PPT files and restore tables, header, footer, & charts, etc. like new
      • File Repair ToolkitRepair corrupt Excel, PowerPoint, Word & PDF files & restore data to original form
    • Data Recovery & Erasure
      • Data RecoveryRecover lost or deleted data from HDD, SSD, external USB drive, RAID & more.
      • Tape Data RecoveryRetrives data from all types and capacities of tape drives including LTO 1, LTO 2, LTO 3, & others.
      • Virtual Machine RecoveryRecover documents, multimedia files, and database files from any virtual machine
      • File ErasurePermanently wipe files and folders, and erase traces of apps and Internet activity.
      • Mobile ErasureCertified and permanent data erasure software for iPhones, iPads, & Android devices
      • Drive ErasureCertified and permanent data erasure software for HDD, SSD, & other storage media
    • Toolkit
      • Exchange Toolkit5-in-1 software toolkit to recover Exchange database, convert EDB to PST, convert OST to PST, restore Exchange backup, and reset Windows Server password.
      • Outlook ToolkitComprehensive software suite to repair PST files, merge PST files, eliminate duplicate emails, compact PST files, and recover lost or forgotten Outlook passwords.
      • File Repair ToolkitPowerful file repair utility to fix corrupt Word, PowerPoint, and Excel documents created in Microsoft Office. It also repairs corrupt PDF files and recovers all objects.
      • MS SQL Toolkit5-in-1 software toolkit to repair corrupt SQL database, restore database from corrupt backup, reset database password, analyze SQL logs, & interconvert databases.
      • Data Recovery ToolkitSoftware helps to recovers deleted data from Windows, Mac and Linux storage devices. Also supports recovery from RAIDs & Virtual Drives.
    • Forensic
      • Email ForensicAdvanced email forensic solution for cyber experts to audit, analyze, or investigate emails & gather evidences.
      • Log Analyzer for MySQLAnalyze forensic details of MySQL server database log files such as Redo, General Query, and Binary Log.
      • Exchange AuditorExchange Server monitoring solution to automate audits, scans and generate reports ìn real-time.
      • Log Analyzer for MS SQLTrack & analyze MS SQL Server database transactions log files.
  • Our Partners
  • Lab Services
  • Support
  • About

Trending Searches

Data Recovery

Photo Recovery

Video Repair

iPhone Data Recovery

File Erasure Software

Exchange Repair

OST to PST

PST Repair

Raid Recovery

MS SQL Repair

MySQL Repair 4 minute read

How to Repair MySQL Tables Using Mysqlcheck

Charanjeet Kaur
Written By
Charanjeet Kaur
Kuljeet Singh
Approved By
Kuljeet Singh
stellar calander
Updated on
January 23rd, 2023

Summary: This blog describes 'how to repair MySQL tables using mysqlcheck' command. Also, find reasons causing corruption in a MySQL table. The mysqlcheck command only works when the server is running. You may consider using a MySQL repair tool to fix corruption in both MyISAM and InnoDB database tables. The tool works even when the server is not running.

Free Download for Windows Free Download for Windows

Contents

  • Backing up MySQL Tables
  • Steps to Repair MySQL Tables using Mysqlcheck
  • Alternatives to Repairing MySQL Tables
  • EndNote

Occasionally, you may need to repair corruption in MySQL tables. Corruption in a database and its tables typically happens when a mysqld process gets killed in the middle of an update or write operation. Also, events like unexpected system shutdown, hardware errors, etc. could easily corrupt a database table.

A corrupt table can render the data unreadable. To regain access to the data, you must first try restoring the table from an updated database backup. If it’s not possible, you must repair the corrupted table. If your server is running, use the ‘mysqlcheck’ command to repair all or a specific table.

Note: The mysqlcheck command works when the server is running. If the server is no longer running or has crashed, you may use the myisamcheck command to repair a corrupt MyISAM table. For recovery of a corrupted InnoDB table, try forcing InnoDB recovery. If nothing works, you may consider repairing the corrupted MySQL tables using a MySQL repair software.

Before repairing the database tables, you must take backup of the tables to prevent data damage.

Backing up MySQL Tables

To take backup of all the files of your databases, do the following:

  • Log in to your MySQL server and stop the server using the command:
service mysql stop
  • Copy all the files of your database into a new directory by running the below command:
cp -r /var/lib/mysql /var/lib/mysql_backup
  • Now, restart the server:
service mysqld start

Steps to Repair MySQL Tables using Mysqlcheck

After backing up the data, begin troubleshooting the corrupted MySQL tables by running the mysqlcheck command. The procedure to repair tables in MySQL database using mysqlcheck is as follows:

Note: In the following steps, replace ‘db_name’ and ‘tbl_name’ with the name of your database and table to be repaired.

Step 1: Check the MySQL Tables for Corruption

Before you repair the table, run the mysqlcheck command with ‘-c’ option to identify corrupted tables:

mysqlcheck –c db_name

This command will check for errors in all the tables of a specified database.

Alternatively, run the below command to check a specific table for corruption:

mysqlcheck –c db_name tbl_name

If the output of this command returns OK, it means that the table is not corrupted. But, if it reports table errors, you must repair it.

Step 2: Repair the Tables

To repair a table, specify the database name and the table name along with ‘-r’ option as shown below:

mysqlcheck -r db_name tbl_name

This command only repairs MyISAM tables. To repair corrupted InnoDB tables, read this: Best Ways to Repair InnoDB Table Corruption in MySQL.

Alternatives to Repairing MySQL Tables

If using mysqlcheck with the repair option fails to fix corrupted tables, try alternative methods to rebuild or repair a table recommended by Microsoft. However, these methods may result in data integrity issues. Also, you may lose some data.

One of the easiest methods to repair database tables without data loss is to use a third-party MySQL repair tool. Stellar Repair for MySQL is an efficient tool you can use to fix corruption in MyISAM and InnoDB tables.

free-download

Download and install the SQL repair tool. After installation, launch the tool and follow these steps:

Step 1: Click OK to proceed with the repair process.

Instruction Window

Step 2: Select MySQL version and data folder containing the database with corrupted tables.

Select Mysql Data Folder

Step 3: After making the appropriate selection, click OK.

Mysql Data Folder Selected

Step 4: Select all or a specific database containing tables you want to repair, and then click Repair.

Select Databases to be Repaired

Step 5: After completion of the repair process, click OK.

Mysql Database Repaired Message

Step 6: A window opens with a list of all the recoverable tables and other objects on the left pane. Click on the table to view its data on the right pane. Select the tables you want to repair, click Save from the File menu.

Preview Recoverable Table Data

Step 7: On the Save Database dialog box, select ‘MySQL’ file format to save the repaired tables. Next, enter the server details for saving the file with restored tables. Click Save.

File Saving Options

You will get a message after the file gets saved.

EndNote

Whether you’re having trouble opening MySQL tables or accessing the records, using mysqlcheck can help check corruption in MySQL tables and repair them. If this didn’t work, try the alternative methods suggested in this blog to restore the table. For further support or any queries, leave a comment below.

About The Author

Charanjeet

Charanjeet is a Technical Content Writer at Stellar®who specializes in writing about databases, e-mail recovery, and e-mail migration solutions. She loves researching and developing content that helps database administrators, organizations and novices to fix multiple problems related to MS SQL and MySQL databases and Microsoft Exchange.

Best Selling Products

Stellar Data Recovery Professional for Windows

Stellar Data Recovery Professional for Windows

Stellar Data Recovery has the right Windows Recovery tool for all your data recovery

Read More
Stellar Data Recovery Professional for Mac

Stellar Data Recovery Professional for Mac

Stellar Data Recovery for Mac program performs safe..

 

Read More
Stellar Photo Recovery

Stellar Photo Recovery

A comprehensive photo recovery software to restore photos, music & video files

 

Read More
Stellar Repair for Video

Stellar Repair for Video

Powerful video repair tool for repairing corrupt or damaged MOV and other video files

 

Read More

Leave a comment Cancel reply

Your email address will not be published. Required fields are marked *

Image Captcha
Refresh Image Captcha

Enter Captcha Here :

Table of Contents    arrow

  1. Backing up MySQL Tables
  2. Steps to Repair MySQL Tables using Mysqlcheck
  3. Alternatives to Repairing MySQL Tables
  4. EndNote

Categories

offer banner

Related Posts

related post
MySQL Repair

How to Check Database Corruption in MySQL?

Stellar Author Bharat Bhushan March 10, 2023 Read More
related post
MySQL Repair

Database Page Corruption on Disk or a Failed File Read of a Page in MySQL

Stellar Author Bharat Bhushan March 6, 2023 Read More
related post
MySQL Repair

[Fixed] MySQL innodb_force_recovery is Not Working Properly

Stellar Author Charanjeet Kaur January 21, 2022 Read More

Free Trial for 60 Days

Technology You Can Trust A Brand Present Across The Globe

  • tuv1
  • tuv2
  • Nist
  • hipa

Stellar Official Website

Stellar Data Recovery Inc.
48 Bridge Street Metuchen,
New Jersey 08840,
United States

ALSO AVAILABLE AT

ALSO AVAILABLE AT

About

  • About us
  • Career
  • ISMS Policy
  • Privacy Policy
  • Terms of Use
  • License Policy
  • Refund Policy
  • End User License Agreement

RESOURCES

  • Blog
  • Articles
  • Product Videos
  • Knowledge Base
  • Case Studies
  • Whitepapers
  • Software Catalog

NEWS & EVENTS

  • News
  • Events

PARTNERS

  • Affiliates
  • Resellers
  • Distributors

Useful Links

  • Contact Us
  • Support
  • Special Offers
  • Student Discounts
  • Awards & Reviews
  • Downloads
  • Store
  • Sitemap

Stellar & Stellar Data Recovery are Registered Trademarks of Stellar Information Technology Pvt. Ltd. © Copyright 2023 Stellar Information Technology Pvt. Ltd. All Trademarks Acknowledged.

Follow Us Facebook Twitter Linkedin Youtube

  • Notron
  • dcma

Subscribe to our newsletter!

Its good time to subscribe and get the latest promtion

With subscribing you agree with our Terms & Conditions

This website uses cookies in order to provide you with the best possible experience and to monitor and improve the performance of the site in accordance with our cookie policy. You can reject cookies at any time in your browser settings.

cookies-cross
Got it