dbmapping recreate on all users
Hi, I created on the shell a lot of databases for different users. I know, this should be done with the API way. But nevertheless, I have now problems when transfer accounts on another server. Because the databases are not assigned to the account.
There is the script dbmaptool which should correct the assignement from DB to the specific account. But there are a lot of users and databases on a server to fix.
Is there another possibility to automate this process?
I have this situation for all accounts/DBs:
DB: username_DBNAME
USER: username_DBUSER
Maybe there is a "check-script" from cPanel which will detect unassigned databases and can correct them (update the yaml file).
Thank you
Roland
-
Maybe there is a "check-script" from cPanel which will detect unassigned databases and can correct them (update the yaml file).
Hello, There's so such script, but you can use the tool via the command line instead of the UI:-bash-3.2# /usr/local/cpanel/bin/dbmaptool /usr/local/cpanel/bin/dbmaptool cpuser --type mysql|pg --dbusers 'user1, user2' --dbs 'db1, db2' These flags are treated individually. This tool will not map a virtual user to a database. /usr/local/cpanel/bin/dbmaptool user1 --type mysql --dbs 'db1' --dbusers 'virt1' /usr/local/cpanel/bin/dbmaptool user1 --type mysql --dbs 'db1' && /usr/local/cpanel/bin/dbmaptool user1 --type mysql --dbusers 'virt1' The above two commands are analogous; result in cpuser 'user1' having privileges for 'db1' and having a virtual user named 'virt1.'
Thank you.0 -
Yes, I know. But that means that you have to enter the mapping for each user manually. I would be better to check the mappings on the whole server automatically. So each user to user_DBNAME / user_DBUSER Thank you 0 -
There are no native tools to do that as it's not possible to associate a database with an account if the database was added manually. You may want to consult with a qualified system administrator if you are looking for assistance with developing a custom script for such an action. Thank you. 0
Please sign in to leave a comment.
Comments
3 comments