If your WHMCS and WP are on different server, you need to set permissions on WHMCS database so that a remote MySQL connection can be made . First thing you will do is to allow the connection from within cPanel for the IP address of the server where WP is installed.
Adding your system’s IP address on cpanel to allow a remote MySQL connection
Firstly, make sure you have an IP address that will access the database. This is the main IP address of the server, not of the WP domain. Now log into cPanel. In the databases section look for “Manage Remote MySQL access” and click it.
Next step, you’ll need to add IP address into the field on the page and select “Add Host“.
Now, you will be able to connect to the databases. You can add as many IP addresses as you need.
Using a Wildcard to allow all IP’s if your IP address changes regularly
You may find you need to use a wildcard if your IP address changes regularly. You can add a wildcard by using the “%” symbol. This will add all IP addresses in that range.
Suppose if you want to list all IP addresses in the range 22.214.171.124 to 126.96.36.199, you’d add the IP address 174.77.92.%.
Or if you are unsure of your IP, your can simply put “%” without qoutes to allow connection from any IP.
For more help see Video