Symptoms
When attempting to add a database user to a database in cPanel, you are presented with an error similar to the following.
The system failed to grant privileges on the database "$databasename" to the user "$dbusername" because of an error: (XID fjur83n) This system will not add the database user "$dbusername" to the database "$databasename" because this user does not have a password.
Description
This issue occurs when the database user exists in the cPanel user's database map file, but not in the mysql.user table. Rebuilding the database map file will correct this issue.
Workaround
- Access the server's command line as the 'root' user via SSH or "Terminal" in WHM.
- Move the user's JSON database map file out of the way.
mv -v /var/cpanel/databases/$cpusername.json{,.$(date +%s)}
Please note that "$cpusername" must be replaced with the cPanel user's username. - Run the
rebuild_dbmap
script for the user./scripts/rebuild_dbmap $cpusername
Please note that "$cpusername" must be replaced with the cPanel user's username.