Get The Most Affordable Hosting in the World!
Starting at just $1.87/month, Vercaa offers unbeatable pricing for world-class web hosting services.
Fast, reliable, and secure hosting to power your website without breaking the bank. Plus, enjoy a free CDN for faster loading times worldwide!
Get Started Now!Introduction
When applying an update to the WHMCS software an error stating Base table or view not found is displayed. The full error may look like:
Unable to complete incremental updates: Unable to import the 8.0.0 Alpha1 database file.
Unable to import /path/to/whmcs/resources/sql/upgrade800alpha1.sql: SQLSTATE[42S02]:
Base table or view not found: 1146 Table 'table_whmcs7.tbldomainpricing_premium' doesn't exist
This guide demonstrates how to resolve this error.
Cause
This error occurs when a table does not exist in the WHMCS MySQL database, but the update process needs to make a change to that table.
In this example the tbldomainpricing_premium table does not exist. It should be present.
A missing table could be caused by an update failure in the past, or accidental/malicious removal of the table.
Resolution
The table identified by the error message must be re-created. Follow these steps:
1. Navigate to the /resources/sql/install/ directory
2. Identify the .schema.sql file with the filename corresponding to the missing table name. In this example that's tbldomainpricing_premium.schema.sql:
![Open the .schema.sql file for the missing table](https://media.screensteps.com/image_assets/assets/003/654/651/original/2b74a792-1de7-4520-a2b3-c9e10474a1d6.png)
3. Edit the file to view its contents
4. Copy the SQL CREATE TABLE command shown in the file. For example:
![Identify the CREATE Table command](https://media.screensteps.com/image_assets/assets/003/654/653/original/782c34de-804a-4ae1-8cdc-0876062c1c38.png)
5. Using a database administration tool such as phpmyadmin, execute the SQL command copied from the .schema.sql file. For example:
![Execute the CREATE TABLE command against the WHMCS Database](https://media.screensteps.com/image_assets/assets/003/654/649/original/431f8385-1ca4-4628-8fed-4cbf0e6b0494.png)
6. Ensure the create query executes successfully:
![Command Successful](https://media.screensteps.com/image_assets/assets/003/654/655/original/e6c2cd88-cb4a-4db9-a97a-4f165cbd5def.png)
7. You may now return to WHMCS and re-run the update process.