SSMS on my laptop could not connect to SQL in Azure Virtual Machine, even though it worked fine on the VM itself. Here is how I fixed the connection.
Kill All Processes for a Database in SQL Server
To kill all processes for a database, set it to SINGLE_USER with ROLLBACK IMMEDIATE and then back to MULTI_USER. This post tests that method against two open sessions, compares it with a KILL script and with RESTRICTED_USER, and explains when each one fits. It also covers what the killed sessions see and why you should not do this on production without asking.



![MySQL - Connection Error - [MySQL][ODBC 5.3(w) Driver]Host 'IP' is Not Allowed to Connect to this MySQL Server](https://blog.sqlauthority.com/wp-content/uploads/2018/03/mysql-login-err-04.jpg)



