database - Syntax error on IF EXISTS -


im having trouble in drop user if exists statement in mysql workbench. error is

syntax error : unexpected if. 

enter image description here

the if exists syntax drop user new feature in mysql 5.7. not implemented in mysql 5.6.

https://dev.mysql.com/doc/refman/5.7/en/drop-user.html says:

as of mysql 5.7.8, if exists clause can used, causes statement produce warning each named account not exist, rather error.

it's possible mysql workbench has not caught syntax. can try upgrade latest version of mysql workbench, , hope have updated it.

or can try putting new clause version-specific comment:

drop user /*!50708 if exists */ ... 

this comment syntax mysql uses protect syntax isn't supported earlier versions. see https://dev.mysql.com/doc/refman/5.7/en/comments.html explanation.


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -