I'm currently attempting to manually remove 2FA for my GitLab server's administrator account, since I've lost access to both my OTP app, and the recovery keys for the account.
There is only one account with administrator access.
According to this comment, the correct way to do this is to set
sudo gitlab-rails dbconsole
SET "otp_required_for_login" = false
WHERE username = "gl_administrator";
ERROR: syntax error at or near ""gl_administrator""
LINE 3: WHERE username = "gl_administrator";
You must use single-quotes when referencing a string literal.
So, your query would simply change to:
WHERE username = 'gl_administrator';