Skip to main content

dbmapping recreate on all users

Comments

3 comments

  • cPanelMichael
    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
  • roliboli
    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
  • cPanelMichael
    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.