How to kill ecto sessions?

I’m trying to reset my ecto db with mix ecto.reset but I get this error,

The database for MusicDB.Repo couldn’t be dropped: ERROR 55006 (object_in_use) database “music_db” is being accessed by other users

There are 10 other sessions using the database.

How do you kill ecto sessions?

How many applications access the database?

It could be a terminal with psql open…

or the server running…


@kokolegorille I am working locally with one terminal open in Ubuntu 18.04 with PostgreSQL.

Now You know why :slight_smile:

Postgresql forbid this while there are open connections.

1 Like

Judging by the way there are 10 sessions you have another instance of your application running somewhere. You’ll need to shut it down before you can drop the database.


This could an issue in the future what if 1 user is superuser, and 9 are sudo, superuser must be able to override everybody.

Then the superuser can just kill their connections and prevent login until they are done with what they need to do. ^.^