您当前使用的帐户没有足够的特权来更改MySQL用户和特权。
在哪里可以授予超级用户权限,以便我可以从MySQL Workbench执行每个命令?
您当前使用的帐户没有足够的特权来更改MySQL用户和特权。
在哪里可以授予超级用户权限,以便我可以从MySQL Workbench执行每个命令?
The privileges is only related to the user, the client you use has nothing to do with it, so whether you use a workbench or a CLI, it does not matter.
In MySQL privileges are arranged to different "user", and "user" are composed by "username" and "host" (from where you login the mysql), so basically, a user in mysql who own specific privilege looks like:
'foo'@'192.16.22.231', 'bar'@'10.3.243.%' ..
How to improve all the privileges to a specific user? do this as a super user:
GRANT ALL PRIVILEGES ON \*.* TO YOUR_USER
super user is usually 'root'@'127.0.0.1', since you have to grant to your specific 'user', you have to know the IP address from which you login
如果您认为上面的内容有点复杂,而且您的mysql只是快速安装和简单配置的话,您可以尝试这个方法,也许会有所帮助:
execute this:
GRANT ALL PRIVILEGES ON \*.* TO 'your_user'@'%';
john
,该用户可以像默认用户root
一样拥有所有权限,如下所示使用GRANT。*MySQL具有SUPER权限,但它不是用于创建超级用户的权限,您可能需要使用用户root
登录:GRANT ALL ON *.* TO 'john'@'localhost' WITH GRANT OPTION;
或者:
GRANT ALL PRIVILEGES ON *.* TO 'john'@'localhost' WITH GRANT OPTION;
GRANT ALL ON *.* TO 'john'@'localhost';
或者:
GRANT ALL PRIVILEGES ON *.* TO 'john'@'localhost';
apple
数据库的person
表上授予用户john
所有权限(apple.person
),如下所示使用GRANT
命令:GRANT ALL ON apple.person TO 'john'@'localhost';
或者:
GRANT ALL PRIVILEGES ON apple.person TO 'john'@'localhost';
在客户端中执行 SELECT * FROM mysql.user WHERE user = 'your account'\G
。如果所有的 priv 列都是 'Y',则您的帐户具有超级用户权限。
您也可以尝试 UPDATE mysql.user
。然后,执行 flush privileges;
使更改生效。
执行 GRANT ALL PRIVILEGES ON \*.* TO 'your_user'@'%';
添加一个新的超级用户权限帐户。
如果上述所有操作都不允许,请联系 Azure 支持。在云数据库中,某些系统数据库可能无法访问。
我通过以下方式解决了这个问题:
UPDATE mysql.user SET Grant_priv = 'Y' WHERE User = 'root';