I was facing this error while trying to connect to my existing database during the upgrade of my vCenter Server from 5.0 to 5.1. So while trying to connect to my existing database during the installation of vCenter SSO every time it was throwing out this particular error.
Error:
The TCP/IP connection to the host 127.0.0.1 , port 1433 has failed. Error: "Connection refused: connect. Verify the connection properties, check that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port, and that no firewall is blocking TCP connections to the port."
Solution:
Follow the screenshots
Open your SQL server configuration Manager
Select SQL Server Network Configuration and click on Protocols for VIM_SQLXP (which in my case is the server name VIM_SQLEXP)
Make sure the TCP/IP is Enabled as shown below
Now right click the TCP/Ip and select Properties
Select IP Addresses from the top TAB menu. Now make sure the settings are as shown in the below 2 screenshots
Once done restart the SQL server services as shown below and re try to connect the database.