Search
  • For Individuals
      « Back
    • 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.

      Free Standard Professional Premium

    • Video Repair
    • Photo Repair
    • iPhone Data Recovery
  • For Business
      « Back
    • Email Repair & Converter

      Repair for Exchange Converter for EDB Converter for OST Converter for NSF Converter for OST MBOX Repair for Outlook

    • Database & File Repair

      Repair for MS SQL Repair for Access Repair for QuickBooks Software Repair for Excel Extractor for Windows Backup Repair for MySQL

    • Data Recovery & Erasure

      Data Recovery Professional Data Recovery Technician Mac Recovery for Technician Virtual Machine Recovery File Erasure Software Mobile Erasure Drive Erasure File Eraser Software File Eraser Software for Mac

    • Toolkit

      Exchange Toolkit Outlook Toolkit File Repair Toolkit MS SQL Toolkit Data Recovery Toolkit

    • Forensic

      Email Forensic Exchange Auditor Log Analyzer for MySQL Log Analyzer for MS SQL

  • Store
  • Partners
  • Services
  • Offers
  • Support

 

  • For Individuals
    DIY software for anyone who works with data.

    Windows Data Recovery Recovers lost or deleted Office documents, emails, presentations & multimedia files

    Free Standard Professional Premium

    Mac Data Recovery Especially for Mac users to recover deleted documents and multimedia files from macOS

    Free Standard Professional Premium

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

    StandardPremium

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

    Standard Professional Premium

    iPhone Data Recovery Windows Mac Recover deleted photos, videos, contacts, messages etc. directly from iPhone & iPad

    Recover Erase Toolkit

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

    Standard Professional Premium


  • For Business
    • Email Repair
    • Email Converter
    • File Repair
    • Data Recovery & Erasure
    • Toolkit
    • Forensic

    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

    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 PST Convert IBM Notes NSF file & export all mailbox items including emails & attachments to PST

    MBOX to PST Convert 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 PST Convert Windows Live Mail (EML) file & export mailbox data - emails, attachments, etc. - to PST

    Office 365 to PST Connect to Office 365 account & export mailbox data to PST and various other formats

    DBX to PST Convert Outlook Express (DBX) file & export all mailbox data - emails, attachments, etc. - to PST

    SQL Repair Repair corrupt .mdf & .ndf files and recover all database components in original form

    Access Repair Repair corrupt .ACCDB and .MDB files & recover all records & objects in a new database

    QuickBooks Repair Repair corrupt QuickBooks® data file & recover all file components in original form

    MySQL Repair Repair MyISAM & InnoDB tables and recover all objects - keys, views, tables, triggers, etc.

    Excel Repair Repair corrupt Excel (.XLS & .XLSX) files and recover tables, charts, chart sheet, etc.

    BKF Repair Repair corrupt backup (BKF, ZIP, VHDX and .FD) files and restore complete data

    Database Converter Interconvert MS SQL, MySQL, SQLite, and SQL Anywhere database files

    PowerPoint Repair Repair corrupt PPT files and restore tables, header, footer, & charts, etc. like new

    File Repair Toolkit Repair corrupt Excel, PowerPoint, Word & PDF files & restore data to original form

    Data Recovery Windows Mac Recover lost or deleted data from HDD, SSD, external USB drive, RAID & more.

    Technician Toolkit

    Tape Data Recovery Retrives data from all types and capacities of tape drives including LTO 1, LTO 2, LTO 3, & others.

    Virtual Machine Recovery Recover documents, multimedia files, and database files from any virtual machine

    File Erasure Permanently wipe files and folders, and erase traces of apps and Internet activity.

    Standard Corporate

    Mobile Erasure Certified and permanent data erasure software for iPhones, iPads, & Android devices

    Drive Erasure Certified and permanent data erasure software for HDD, SSD, & other storage media Windows Mac

    Exchange Toolkit 5-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 Toolkit Comprehensive software suite to repair PST files, merge PST files, eliminate duplicate emails, compact PST files, and recover lost or forgotten Outlook passwords.

    File Repair Toolkit Powerful 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 Toolkit 5-in-1 software toolkit to repair corrupt SQL database, restore database from corrupt backup, reset database password, analyze SQL logs, & interconvert databases.

    Data Recovery Toolkit Software helps to recovers deleted data from Windows, Mac and Linux storage devices. Also supports recovery from RAIDs & Virtual Drives.

    Email Forensic Advanced email forensic solution for cyber experts to audit, analyze, or investigate emails & gather evidences.

    Exchange Auditor Exchange Server monitoring solution to automate audits, scans and generate reports ìn real-time.

    Log Analyzer for MySQL Analyze forensic details of MySQL server database log files such as Redo, General Query, and Binary Log.

    Log Analyzer for MS SQL Track & analyze MS SQL Server database transactions log files.

    STELLAR EMAIL FORENSIC

    Advanced email forensic tool to analyze and collect the mailbox data of email clients

    Learn More arrow


    All Products

    All Products

    All Products

    All Products

  • Our Partners
  • Lab Services
  • 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

  • English Deutsch Français Nederlands Italiano Español 日本語 简体中文
  • Support
MySQL Repair 4 minute read

How to Repair MySQL Tables Using Mysqlcheck

Published on July 17th, 2021
Charanjeet Kaur
Written By
Charanjeet Kaur
Kuljeet Singh
Approved By
Kuljeet Singh

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.

How to Repair MySQL Tables Using Mysqlcheck

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.

Contents

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

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 has the right Windows Recovery tool for all your data recovery

Read More

Stellar Data Recovery Professional for Mac

Stellar Data Recovery for Mac program performs safe..

 

Read More

Stellar Photo Recovery

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

 

Read More

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 *

  −  7  =  1

Table of Contents    

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

Categories

Related Posts

MySQL Repair

[Fixed] MySQL innodb_force_recovery is Not Working Properly

Stellar Author Charanjeet Kaur January 21, 2022 Read More
How to Repair MySQL Database using phpMyAdmin
MySQL Repair

How to Repair MySQL Database using phpMyAdmin?

Stellar Author Charanjeet Kaur November 11, 2021 Read More
recover mysql database from ibdata1
MySQL Repair

How to Recover Data from ibdata1 File

Stellar Author Charanjeet Kaur May 3, 2021 Read More

Stellar Official Website

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

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
Follow Us

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

DMCA.com Protection Status
We use cookies on this website. By using this site, you agree that we may store and access cookies on your device Read More Got it!