Well, I suppose there can be infinite reasons for such an error. In my case, nonetheless, the solution was the following:
Enable the TCP/IP connection in SQL Configuration Manager.
Open the SQL Server Management Studio (if you do not have it installed, install it; it can have its own pitfalls, however).
Right-click on the database server (as in the picture below) and click in
Properties
.- Select the
Security
option and markSQL Server and Windows authentication mode
. Click in OK. - Open the SQL Server Configuration Manager and restart the SQL Server service.
After this, I got my connections without problems. This article helped me a lot.