gpt4 book ai didi

MySQL:给 root 密码后无法创建用户帐户

转载 作者:行者123 更新时间:2023-11-29 14:31:08 27 4
gpt4 key购买 nike

我在 EC2 实例中安装 MySQL,然后为 root 提供密码。

现在我正在尝试创建本地主机域和“%”域的用户。创建用户就可以了:

CREATE USER 'valter'@'localhost' IDENTIFIED BY '******';

但是当我尝试授予它一些权限时:

GRANT ALL PRIVILEGES ON *.* TO 'valter'@'localhost' WITH GRANT OPTION;

给我以下错误:

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

Here它说:

shell> mysql --user=root mysql If you have assigned a password to the root account, you will also need to supply a --password or -p option, both for this mysql command and for those later in this section.

但是它应该是什么样子的命令呢?

我在这里做错了什么?

我想创建一个也可以访问本地主机和外部网络的用户。

最佳答案

这是 EC2 的问题,而不是 MySQL 的问题。 Here's a relevant forum entry:

The issue is that the RDS instance does not have superuser rights so I can't "grant all privileges" to any user.

I was able to get my application to work by creating the user with the specific rights that I need (insert, update,create, etc)

这个论坛讨论可能也值得一看:

https://forums.aws.amazon.com/thread.jspa?threadID=64618

关于MySQL:给 root 密码后无法创建用户帐户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10019717/

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