Create a dedicated database and user for a self-hosted WHMCS installation. Keep its credentials separate from unrelated websites so access can be managed and recovered without sharing another application's database identity.
IN THIS ARTICLE
01 Prepare the database
- Confirm the database engine and configuration meet the requirements of your chosen WHMCS version.
- Use your hosting control panel or authorised database administration tool to create an empty database.
- Create a unique database user with a strong password and grant the installation privileges WHMCS requires on that database.
- Record the database host, name and username securely. Include any required account prefix shown by the control panel.
- Enter those details during the supported WHMCS installation process.
- After installation, verify the application connects and that its initial tables and settings are present.
02 Review privileges and SQL mode
Installation, upgrades and module schema changes require privileges beyond ordinary reads and writes. Use the vendor's privilege list for the task and review whether elevated schema privileges can be removed between maintenance operations.
WHMCS documents restrictions on MySQL strict mode. Have the server administrator assess the appropriate database configuration for this application. Do not apply an unreviewed server-wide SQL-mode change to unrelated applications simply to complete the installer.
03 Protect the configuration
The installation's configuration.php contains the database settings and other sensitive values. Back it up securely and apply file permissions suitable for the actual PHP process owner. Do not place a readable backup copy in the public web root.
Preserve the installation's encryption material when moving or restoring WHMCS. Replacing it with a new arbitrary value is not a password-reset procedure and can make stored secrets unusable.
What should I check when WHMCS cannot connect to its database?
Verify the exact hostname, prefixed database and username, password and grants. For a remote database, check firewall access and the intended encrypted connection configuration. Correct certificate or hostname problems rather than disabling verification as a routine fix.
Once the installation works, create the first backup and test that your chosen recovery process can restore it into an isolated environment. A database that exists but has never been tested for recovery is an incomplete operating setup.