
MSSQL is a suite of database software published by Microsoft. It includes a relational database engine, which stores data in tables, columns, and rows. As a database server, it is a software product with the primary function of storing and retrieving data as requested by other software applications and this may run either on the same computer or on another computer across a network.
Error 1: Cannot connect to the localhost, connection timed out.

MsSQL Connection timeout
Solution:
Furthermore, Simply increase the timeout error in the MS Management Studio connection settings (increase from 30 t0 120 and remember to turn this back again to the default after the first connection). Fix the initial timeout connection and this can be changed afterward. Increased connection timeout to 120.

Error 2: However, Cannot connect “An exciting connection was forcefully closed by the remote host Sql Exception with error number 10054

Solution: Try to identify and understand your environment to resolve this issue.
– This error clearly shows that the problem is not the firewall or the remote connections but the login process.
This was not resolved because connection seems to work but the authentication method I tried to use is not supported by the database instances and therefore did not work. I was trying to connect using Domain Account and this was not supported.
Moreover, I hope you found this blog post on MsSQL Connection timeout helpful. Please let me know in the comment session if you have any questions.