If you host your AIO on Ubuntu or Debian, then the easiest way to get database console access is with the → nc-sql ← script.
Once installed, (It detects your nextclloud on its own) you only have to run
nc-sql
and you get an sql Prompt. No need for a password, since the script reads it from the nextcloud config.
hth.
Much and good luck,
ernolf