How does one run sql queries if the container doesn't start? (rebuild failed)

Edit the tag (by going to /tag/foo) and either rename it or remove it.