Clear extra access hosts for system account during db removal

Version 1.53


Bug where if you have an extra access host on a DB, let's call it: when you delete that DB, the system account "user" will still have the access host in the mysql.user table. Fix was to run a query before the DB removal, that clears all instances of that user, where the access host does not exist in any other DB in mysql.db. Query logic is: DELETE FROM mysql.user WHERE host NOT IN (SELECT host FROM mysql.db WHERE (db!='username_db' AND db!='username\_db'') AND (db LIKE 'username_%' OR db LIKE 'username\_%')) AND user='username'

Interested to try DirectAdmin? Get a 30-day Free Trial!