How to setup a wordpress backup in localhost?

Before import database_backup.sql. You have to replace server url with your local url in sql. for example: you took backup from abc.com , and your local url is localhost/abc .then open database_backup.sql and find and replace abc.com with localhost/abc. Save and import now.