Use a cláusula IF EXISTS
:
DROP USER IF EXISTS '${test}'@'localhost';
An error occurs if you try to drop an account that does not exist. If the
IF EXISTS
clause is given, the statement produces a warning for each named user that does not exist, rather than an error.