Sometimes in SQL you need to delete some rows, delete a Table or the DB. But what if a user is still connected to it. The solution is simple, kill all the sessions on that DB with a simple script:

 

For MySQL, you could try this: