In learning the drop method to delete the user, according to the book has not been operational success, and then to the online search for some other information, only to understand the method of the drop, posted out and share with you.
(method i) Drop User user name;
Syntax: Drop User user name;
role: Delete the user that already exists, for example to delete Yan, (dropUseryan;) The default deletion is [email protected] "%" This user, if there are other users, such as [email protected] "localhost", [email protected] "IP", will not be deleted together. If there is only one user [email protected] "localhost", use the statement (dropUserYan;) will error, should use (dropUser[email protected] " localhost ";) if you cannot determine the name of the machine (user name @ machine name), you can find it in the user table in MySQL, which corresponds to the username, and the host column corresponds to the machine name.
from user where and host= "localhost";
delete is also a way to delete a user, for example to remove [ Email protected] "localhost" user, you can (delete FROM&NBSP, user &NBSP, where user= "Yan" &NBSP, and host= "localhost" ;)
Note: Drop deleted users not only delete data from the user table, but also delete content such as DB and other permission tables. and (method two) just delete the contents of the user table, the other tables will not be deleted, later if the name of a deleted user and the same names, permissions will be inherited.
This article from "Dongdong Homeland" blog, declined reprint!
MySQL removes the difference between users using the drop and delete methods