When I select localhost I receive an error

Try 127.0.0.1.  If it works you can correct your hosts file where is shows localhost.