I have a brand new mysql installation. I want to delete a user only if exists and I have only root
user. I'm trying to run from shell:
DROP USER IF EXISTS foo;
or
DROP USER IF EXISTS 'foo'@'localhost';
But mysql returns this kind of messages:
ERROR 1064 (42000): 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 'IF EXISTS foo' at line 1
What am I doing wrong?
I read this post but does not explain why IF EXISTS
statement does not work