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!Symptom
When applying an update to WHMCS, a Command denied to user error displays. For example:
Unable to complete incremental updates: Unable to import the 7.5.0 Alpha1 database file. Unable to import /path/to/whmcs/resources/sql/upgrade750alpha1.sql: SQLSTATE[42000]: Syntax error or access violation: 1142 CREATE command denied to user 'dbuser'@'localhost' for table 'tblaffiliates_hits'
or
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[42000]: Syntax error or access violation: 1142 INDEX command denied to user 'dbuser'@'localhost' for table 'tblactivitylog'
Cause
This error occurs when the MySQL® user has insufficient privileges in the WHMCS database to perform the schema changes that the update process requires.
In the above examples, the dbuser
user does not have the CREATE
and INDEX
privileges. A system administrator has restricted the database user's privileges.
Resolution
To resolve this issue, update the database user to include the required privileges.
For example, in cPanel & WHM, you could perform the following steps:
1. In the cPanel interface, navigate to Databases > MySQL® Databases.
2. Click the Privileged Users link that corresponds to the WHMCS database:
![cPanel - MySQL® Databases](https://media.screensteps.com/image_assets/assets/005/158/284/original/0c946b6a-11ee-4af9-a99e-44e9138ae55f.png)
3. Check the missing privileges or check ALL PRIVILEGES.
![cPanel - Manage User Privileges](https://media.screensteps.com/image_assets/assets/005/158/286/original/8ea40ddb-c798-47ee-8d2a-8a5c71599e41.png)
4. Click Save.
5. In WHMCS, attempt the update process again.
For more information, see Database Privileges.