
Originally Posted by
DWHS.net
Anyone come up with a way to know which mysql accounts to delete on the remote mysql server?
cpanel leaves all mysql DB on the remote server after the the account is deleted in cpanel.

What do you mean by "you don't always know for sure if the database is for a full account or a add-on" - I'm not understanding the 'add-on' part.
AS for a work around to this, normal account termination will call /scripts/legacypostkillacct and /scripts/postkillacct /scripts/legacypostkillacct might be the easiest to use since the first argument passed to it is the name of the user account to terminate. Some quick, untested code that illustrates this:
Code:
#!/bin/bash
set USER=$ARGV[0]
mysql -h 192.168.0.1 -u root < "DROP DATABASE $USER"
Granted, that's only going to delete the primary database of the user, not databases in the format user_dbname. Nor does it revoke privileges.