This Python script automates the process of setting MySQL database privileges for users managed under a cPanel/WHM environment. It leverages the cPanel's UAPI and WHM API to modify database privileges based on a predefined list of users. The script is particularly useful for system administrators who need to manage database access rights efficiently across multiple users.
- List Accounts: Retrieves all cPanel accounts using the WHM API. List Databases and Users: For each cPanel account, it lists all associated MySQL databases and the users who have access to them.