DROP USER IF EXISTS 'user'@'%'; code example Example: mysql delete user if exists DROP USER IF EXISTS 'user'@'127.0.0.1' ;