Someone may need this (reinstalling magento engine) in some cases like trying to install template and sample data.
So in that case of reinstalling Magento engine and the database from scratch, follow this steps:
• Go to your database(for your magento project) through phpMyAdmin or other one and drop the tables. If you can not drop some tables, just empty those tables.
• Then go to your Magento project root and delete local.xml
file located in app/etc
folder.
• Now you should be able to see the primary installation page where you can start the installation procedure.
Enjoy!