Admin-Ahead Community

Windows => General Windows => Topic started by: sachinj on January 27, 2018, 04:36:30 pm

Title: Repair MySQL Database through Windows Command Line
Post by: sachinj on January 27, 2018, 04:36:30 pm
Repair MySQL Database through Windows Command Line
---------------------------------------------------------------------------------------------------------

1. Login to your Windows VPS using Remote Desktop.

2. Go to Start and locate Command Prompt. Right click Command Prompt and select Run as Administrator option.

3. At windows command prompt navigate to MySQL bin directory as follows.

Code: [Select]
cd C:\Program Files\MySQL\MySQL Server 5.5\bin  //  Replace your MySQL bin directory path here.
4. Run the following command to start the MySQL prompt.

Code: [Select]
mysql -u root -p
5. Enter MySQL root password when you are being asked.

6. You will see mysql prompt appearing. Now, to display all databases, type following command at mysql prompt:

Code: [Select]
show databases;
Enter the following command to repair MySQL database.

Code: [Select]
mysqlcheck -r [database] // Replace database name with your database name.
===========================================================================