The dbmaptool Script
Valid for versions 82 through the latest version
Last modified: May 13, 2020
You can use the /usr/local/cpanel/bin/dbmaptool script to grant ownership of databases and database users to a cPanel user via the command line.
How to call the script
To run this script on the command line, use the following format:
/usr/local/cpanel/bin/dbmaptool user option
Use the following options with this script:
--type— The database type to which you wish to assign owners.
--dbs— A comma-separated list of the database names that the cPanel user will own.
--dbusers— A comma-separated list of the database users that the cPanel user will own.
For example, if you wish to grant ownership of the
db1 MySQL® database with the
virt1 database user to the
user1 cPanel user, run the following command:
/usr/local/cpanel/bin/dbmaptool user1 --type 'mysql' --dbs 'db1' --dbusers 'virt1'
If the script succeeds, it will not return output.