This is a very weird problem which is not very common and also not even discussed in any forum before. Here is the scenario: This problem occurs when you are installing WordPress in local machine with WAMP server. Below are the further steps to replicate it:

  1. Create configuration file as normally we do.
  2. Enter the database details required for the installation.
  3. Hit the famous sparky installation button.

Now after a while you should expect the next step where you have to enter the admin details, but the problem starts from here only. You will get the message of

Installation failed. Database needs to be repaired

with a link to ‘repair database’. When you will click on the link, it will again show the same message. If you starts some little investigation then you will find that installation process has not created all the table required for the proper installation of the WordPress. So here is the culprit.

This problem bugged me a lot as the solution nowhere available. I checked out everything starting from SQL logs to server logs but couldn’t find anything. So I thought that I have to repeat the installation process again with everything fresh. This time again I wasn’t so lucky but one thing I noticed that this time the number of tables created was different as that of previous one. This was the clew.

This was the direct hint that something is causing SQL table creation threads to die i.e. server was resource limited. Now I opened php.ini file and changed the following settings:

Old:

New:

After changing these values the installation process went smooth. Finally the conclusion is that the local server was resource limited which was causing the WordPress installation error. Hope this may be helpful to someone. Feed-backs are welcome.

Homephp.iniWordpressWordpress ErrorsDatabase needs to be repaired – WordPress Installation Error