![sqlectron exe sqlectron exe](https://mir-s3-cdn-cf.behance.net/project_modules/disp/b6d81d35963589.570a9afee9e3e.jpg)
There seems to be no need to waste time digging in the grant tables looking for ghosts as one poster suggested.ĭROP USER ' ' // completely delete the account Subsequent CREATE USER at localhost will fail because the localhost user was never deleted. It's clear to me that when it tries to delete the user at %, it issues an error message and quits.
![sqlectron exe sqlectron exe](https://4.bp.blogspot.com/-5DjojpXUeFo/WggL5jb0z2I/AAAAAAAAGn4/JKdxwEgC1IEEZpuK2tbQX7d6aAdumvA5QCLcBGAs/w1200-h630-p-k-no-nu/sqlectron2.png)
Or, it may be that it sometimes works when it deletes the localhost user and then tries to delete the one at %. The only time I get this error is when I do DROP USER user like the doc suggests, but MySQL does not treat the '%' as a wildcard in a way that would drop all users at all hosts. The statement removes privilege rows for the account from all grant tables. This means that the procedure for removing an account depends on your version of MySQL.Īs of MySQL 5.0.2, you can remove an account and its privileges as follows: In MySQL 5.0.2, it was modified to remove account privileges as well. It is a documentation conspiracy - docs vary in one critical place from version to version.ĭROP USER you specify only the user name part of the account name, a host name part of '%' is used.ĭROP USER as present in MySQL 5.0.0 removes only accounts that have no privileges. It's because altering the MySQL tables directly does not reload the info into memory yet the plethora of solutions to this bug claim that FLUSH PRIVILEGES is the answer. It's quite clear why, if one reads the docs. This bug has been sitting on since 2007 and this thread is mainly just a parroting of all those wrong answers even up to a year ago.Īccording to the MySQL documentation, commands like CREATE USER, GRANT, REVOKE, and DROP USER do not require a subsequent FLUSH PRIVILEGES command. Mysql> CREATE USER IDENTIFIED BY 'test123' ĮRROR 1396 (HY000): Operation CREATE USER failed for CREATE USER IDENTIFIED BY 'test123'
![sqlectron exe sqlectron exe](https://yldrmdgn.com/wp-content/uploads/2021/01/2021-01-11_16h49_41.png)
Mysql> delete from user where user = 'jack' (Of course, originally, there was much time between the creation of 'jack' and his removal.) mysql> CREATE USER IDENTIFIED BY 'test123' What have I done to corrupt user 'jack' and how can I undo that corruption in order to re-create 'jack' as a valid user for this installation of MySQL? If I execute this command for some other, random username, say 'jimmy', it works fine (just as it originally did for 'jack'). My case: user 'jack' existed before, but I deleted it from er in order to recreate it. ERROR 1396 (HY000): Operation CREATE USER failed for seem to be unable to re-create a simple user I've deleted, even as root in MySQL.