Page tree
Skip to end of metadata
Go to start of metadata

This document is for a previous release of cPanel & WHM. To view our latest documentation, visit our Home page.

For cPanel & WHM 11.44


You can use the /usr/local/cpanel/dbmaptool script to grant ownership of databases and database users to a cPanel user via the command line.

How to call the dbmaptool script

Run the dbmaptool script with the following flags:

--typeThe database type to which you wish to assign owners'mysql', 'psql'
--dbsThe names of the databases that the cPanel user will own, separated by commas. 'db1', 'db2'
--dbusersThe names of the database users that the cPanel user will own, separated by commas.'virt1', 'virt2'


The system treats each flag individually. If you pass an invalid value with a flag, the script will fail.


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 --mysql --dbs 'db1' --dbusers 'virt1'

If the script is successful, you will not receive confirmation from the command line.



  • No labels