Home > Database > Mysql Tutorial > What should I do if mysql fails to delete a user?

What should I do if mysql fails to delete a user?

藏色散人
Release: 2023-02-13 10:14:40
Original
1451 people have browsed it

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.

What should I do if mysql fails to delete a user?

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';
Copy after login

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';
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template