I need install and use SQL Server 2017 Express Edition.

I downloaded it from this link: Microsoft® SQL Server® 2017 Express and installed basic version to C:\Program Files\Microsoft SQL Server.

I can run it and have access to http://localhost, but I should use And when I use I see the following:

Bad Request - Invalid Hostname
HTTP Error 400. The request hostname is invalid.

I tried to edit my hosts. I went to C:\Windows\System32\drivers\etc, open hosts and uncomment the following line: localhost

# Copyright (c) 1993-2009 Microsoft Corp.
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
# For example:
#     rhino.acme.com          # source server
#     x.acme.com              # x client host

# localhost name resolution is handled within DNS itself.       localhost
#    ::1             localhost

But it has no effect. I have access to localhost, but hasn't on The bad request.

I tried a reboot.

What am I missing?

Windows 10 Pro 64    
Visual Studio 2017
SQL Server 2017 Express Edition 14.0.1000.169, RTM

IIS screen. (Site name, URL address, Identifier)

  • When you configured the database did you use localhost or normally configuration files have to be modified to allow both (i.e. Apache, MySQL, ect.) – Ramhound Feb 2 '18 at 16:26
  • @Ramhound I use the Visual Studio solution that has been created not by me. I just should run it in the studio, update the database and start "run without debugging". It opens the browser on localhost page. But I need use – NaSt Feb 2 '18 at 16:48
  • @Ramhound And I can't find where the author of this .sln configured addresses – NaSt Feb 2 '18 at 16:48
  • You are not looking in the correct place. Look at how IIS is configured. The Visual Studio solution has nothing to do with this problem. – Ramhound Feb 2 '18 at 16:49
  • @Ramhound IIS show's it as localhost only: i.stack.imgur.com/IJZgV.png (Site name, URL address, Identifier) – NaSt Feb 2 '18 at 16:55

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.