gpt4 book ai didi

mysql - 删除用户 'netbeansuser' @'%' ;抛出错误 HY000 (1396) MySQL

转载 作者:行者123 更新时间:2023-11-29 23:28:05 24 4
gpt4 key购买 nike

我错误地创建了一个用户,现在无法删除。以下是与MySQL交互的代码片段:

mysql> DROP User 'netbeansuser'@'%';
ERROR 1396 (HY000): Operation DROP USER failed for 'netbeansuser'@'%'
mysql> select User from mysql.user;
+------------------+
| User |
+------------------+
| root |
| root |
| debian-sys-maint |
| netbeansuser |
| root |
| root |
+------------------+
6 rows in set (0.00 sec)

mysql> DROP User 'netbeansuser';
ERROR 1396 (HY000): Operation DROP USER failed for 'netbeansuser'@'%'
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

mysql> select User from mysql.user;
+------------------+
| User |
+------------------+
| root |
| root |
| debian-sys-maint |
| netbeansuser |
| root |
| root |
+------------------+
6 rows in set (0.00 sec)

mysql> DROP User 'netbeansuser';
ERROR 1396 (HY000): Operation DROP USER failed for 'netbeansuser'@'%'
mysql> DROP User 'netbeansuser'@'%';
ERROR 1396 (HY000): Operation DROP USER failed for 'netbeansuser'@'%'

我做错了什么?特别是,主机名中的“%”符号是做什么用的?我在创建用户时没有指定主机名。任何有关了解 MySQL 用户创建中的主机名绑定(bind)的资源也会有所帮助。谢谢大家。

最佳答案

这会很有帮助。

使用'localhost'而不是'%'

关于mysql - 删除用户 'netbeansuser' @'%' ;抛出错误 HY000 (1396) MySQL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26794202/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com