I’m trying to set up a stored proc that (in part) drops a user. I’ve tried several versions of DROP USER that “expand” the argument and I can’t find one that works. Can someone help?
DELIMITER //
CREATE PROCEDURE `dropuser`( IN inUser varchar(255) )
BEGIN
#DROP USER concat(inUser,"@localhost");
#DROP USER inUser "@localhost";
#DROP USER "inUser@localhost";
END//
DELIMITER ;
CALL dropuser("asdf");
All three of them fail in the same way:
ERROR 1064 (42000) at line 4: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(inUser,"@localhost");
Obviously I’m getting the expansion wrong.
1 Answer