Home >Database >Mysql Tutorial >What should I do if mysql fails to delete a user?
Mysql solution to failure to delete users: 1. Use the "drop user userName; drop user 'userName';" command to delete the user; 2. Use "drop user 'userName'@'224.130.2.104';" Just delete the user using syntax.
The operating environment of this tutorial: Windows 10 system, mysql5.5 version, Dell G3 computer.
What should I do if mysql fails to delete a user?
MySQL deleted user error: ERROR 1396 (HY000): Operation DROP USER failed for 'tsjt'@'127.0.0.1'
Background:
Local installation During the MariaDB of MySQL, two users with different login IPs named tsjt were created, one was 127.0.0.1 and the other was localhost. After the test was completed, it was ready to be deleted.
At this time, it was discovered that the created tsjt The user @127.0.0.1 cannot be deleted, but the user tsjt@localhost can be deleted normally. Later, after many joint debuggings, this problem was finally solved.
Note:
For the current situation Question, my personal positioning on it is very clear. All I want to do is delete this user, and the content involved is not involved, so the purpose becomes very clear.
That is to delete this user The user. deleted the command and typed it over and over again. I also tried many times to pay attention to the key points. I also searched all over the Internet, but in the end I couldn't find a solution to help solve this problem. In the end, I was forced to use the view tool to Log in with root privileges and drop it.
Problem:
MySQL error when deleting a user: ERROR 1396 (HY000): Operation DROP USER failed for 'tsjt'@'127.0.0.1'.
Solution:
1. There are two normal syntaxes for deleting users
The first one:
: drop user userName; : drop user 'userName';
Description: The above In the two methods, if there are users with multiple terminal login permissions, the all users with the highest permissions will be deleted by default.
The second method:
: drop user 'userName'@'224.130.2.104';
2. Then, the above can be deleted normally. If the situation like mine cannot be deleted by command, then it can only be deleted with the help of other graphical tools.
(For this problem, the deletion command was that command, and the reason why it failed , if there is no error in the command, it is basically caused by the environment, version and other external reasons.)
Summary:
For the established user 'tsjt'@'127.0 this time .0.1'If it cannot be deleted, use a graphical tool to delete it.
Recommended learning: "MySQL Video Tutorial"
The above is the detailed content of What should I do if mysql fails to delete a user?. For more information, please follow other related articles on the PHP Chinese website!