If an administrator is locked out of their WHMCS account due to Two-Factor Authentication (2FA) issues (e.g., lost device or app), you can reset 2FA for that user directly via the database.
β οΈ Prerequisites & Warnings
- Backup First: Always back up your WHMCS database before making changes.
- Root or MySQL Access: You must have access to the serverβs database via phpMyAdmin or the MySQL command line.
- Version Compatibility: This guide applies to all WHMCS versions using
tbladmins
for admin authentication.
π οΈ Step-by-Step Instructions
1. Access Your Database
Via phpMyAdmin (WHM/cPanel/DirectAdmin) or MySQL CLI:
mysql -u root -p
Then select your WHMCS database:
USE whmcs_database_name;
Replace
whmcs_database_name
with your actual database name.
2. Run SQL Commands to Reset 2FA
Replace 'ADMIN_USERNAME'
with the actual admin username.
UPDATE tbladmins SET authmodule = '' WHERE username = 'ADMIN_USERNAME';
UPDATE tbladmins SET authdata = '' WHERE username = 'ADMIN_USERNAME';
3. Log into WHMCS Admin Area
- Go to your WHMCS Admin Panel.
- Log in using the affected admin account.
- Navigate to My Account.
- Reconfigure Two-Factor Authentication as desired.
β Confirmation
Once logged in successfully:
- The admin should see the 2FA setup prompt or can manually set it up under My Account β Two-Factor Authentication.
π Optional: Re-enable 2FA Globally (If Needed)
If 2FA was disabled system-wide during recovery, re-enable it via:
WHMCS Admin β Setup β Staff Management β Two-Factor Authentication