为什么不能在mysql中创建新用户?

编程入门 行业动态 更新时间:2024-10-24 16:28:48
本文介绍了为什么不能在mysql中创建新用户?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 mysql> select user,host from mysql.user; +------------------+-----------+ | user | host | +------------------+-----------+ | root | 127.0.0.1 | | root | ::1 | | debian-sys-maint | localhost | | developer | localhost | | jack | localhost | | root | localhost | | root | rebuild | +------------------+-----------+ 7 rows in set (0.00 sec) mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | wpdatabase | +--------------------+ 4 rows in set (0.00 sec) mysql> CREATE USER wpuser@localhost; ERROR 1396 (HY000): Operation CREATE USER failed for 'wpuser'@'localhost'

为什么不能在mysql中创建新用户?用户 wpuser 不在表 user 中.我从未使用过数据库,所以谁能帮我创建一个新用户?

Why can't create a new user in mysql? The user wpuser is not in the table user. I neved used databases, so can anyone help me on how to create a new user ?

不,不是密码的问题(123456是mysql数据库的key).

No,it is not the problem of password(123456 is the key of mysql database).

mysql> CREATE USER 'wpuser'@'localhost' IDENTIFIED BY '123456'; ERROR 1396 (HY000): Operation CREATE USER failed for 'wpuser'@'localhost'

太奇怪了,请继续.

为什么 CREATE USER wpuser@localhost; 不能;CREATE USER wpusers@localhost; 可以吗?

Why CREATE USER wpuser@localhost; can't ; CREATE USER wpusers@localhost; can?

推荐答案

我认为我遇到了同样的问题.我不小心创建了myuser",使用下面的命令删除了它,然后我无法创建用户,尽管它没有出现在 mysql.user 表

I had the same problem I believe. I accidentally created 'myuser', deleted it using the command below, and then I cannot create the user, although its not showing up on mysql.user table

我尝试了这些删除命令,但无济于事.

I tried these commands for deleting but to no avail.

delete user from mysql.user where user='myuser' delete user from mysql.user where user='myuser' and host='localhost' delete user from mysql.user where user='myuser' and host='%'

当我使用此命令删除用户时,它对我有用.

It worked for me when I use this command to remove the user.

DROP USER 'myuser'@'localhost';

在尝试这些命令之间,我FLUSH PRIVILEGES 好像我正在腹泻.因此,如果它仍然不起作用,请按照 Begueradj 的建议进行操作.

In between trying out these commands I FLUSH PRIVILEGES as though I'm on diarrhoea. So in case it still does not work, do what Begueradj suggested.

更多推荐

为什么不能在mysql中创建新用户?

本文发布于:2023-10-17 13:00:06,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1500979.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:能在   建新   中创   用户   mysql

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!