In the article below I wrote a script that performs the initial setup of Omeka S on Amazon Lightsail.

https://zenn.dev/nakamura196/articles/882825ac4ce339

This time I wrote a counterpart that removes it. An example is shown below.

set -e
  
OMEKA_PATH=/home/bitnami/htdocs/omeka-s
DBNAME=omeka-s
rm -rf $OMEKA_PATH

cat <<EOF > sql.cnf
[client]
user = root
password = $(cat /home/bitnami/bitnami_application_password)
host = localhost
EOF

mysql --defaults-extra-file=sql.cnf -e "drop database $DBNAME";

I hope this is helpful for others doing the same.