1

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 http://127.0.0.1. And when I use http://127.0.0.1. 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: 127.0.0.1 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:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

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

But it has no effect. I have access to localhost, but hasn't on 127.0.0.1. 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)

6
  • When you configured the database did you use localhost or 127.0.0.1 normally configuration files have to be modified to allow both (i.e. Apache, MySQL, ect.)
    – Ramhound
    Commented Feb 2, 2018 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 127.0.0.1
    – NaSt
    Commented Feb 2, 2018 at 16:48
  • @Ramhound And I can't find where the author of this .sln configured addresses
    – NaSt
    Commented Feb 2, 2018 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
    Commented Feb 2, 2018 at 16:49
  • @Ramhound IIS show's it as localhost only: i.sstatic.net/IJZgV.png (Site name, URL address, Identifier)
    – NaSt
    Commented Feb 2, 2018 at 16:55

0

You must log in to answer this question.

Browse other questions tagged .