Delete and disconnect the user in MySQL / MariaDB
Drop user in Mysql has one thing if we fire the drop command then the command is executed successfully but it allows us to run the existing connected session until they disconnected. To remove the drop user session, you have to kill them.
Check the user present in MySQL:
select user,host from MySQL.user;
Drop user in MySQL
SYNTAX:
DROP USER [IF EXISTS] user@host;
Example:
drop user 'user2'@'%';
Kill the connected session for the drop User:
-- Check the list of process running
SHOW PROCESSLIST;
--Kill with the following command by using id:
KILL Id;