MySQL: 002 : Repair corrupted MySQL DB

MySQL: 002 : Repair corrupted MySQL DB

Repairing a MySQL DB from Windows Command Line

Step 1: Open the Windows Command Line

- Go to Start >> and Search for 'cmd'. Click on 'Command Prompt' once the Search results show up. You can alternatively type in (Windows + R) to open the Run Dialog and then type in 'cmd' in the dialog and press Enter to launch the Command Prompt.

Step 2: Change your Windows Path to MySQL bin folder

- In Command Prompt, at the cursor type cd "C:\Program Files\MySQL\MySQL Server 5.6\bin". The version of MySQL differs as per your installation, as such recommended to confirm the above path from machine Windows Explorer.
- Press Enter.

Your Windows path will be now re-changed as above.

Step 3: Run the MySQL Repair Command

- At the cursor, type mysqlcheck -u root -p --auto-repair --databases [Database Name]. Replace the Square braces Database Name with the name of your database.
for e.g. mysqlcheck -u root -p --auto-repair --databases MainDB
- Press Enter. It will ask you to enter the password, type in the password for root user. By default, the password for MySQL root user is 'root'.
- The Query will execute and repair all or any table if found corrupted.

You can now launch GLOBODOX and start working with your MySQL DB.