我按照来自 stack overflow 的命令进行操作,但新用户无法创建新用户、数据库并授予权限。
CREATE USER 'monty'@'localhost' IDENTIFIED BY 'some_pass';
GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost' WITH GRANT OPTION;
CREATE USER 'monty'@'%' IDENTIFIED BY 'some_pass';
GRANT ALL PRIVILEGES ON *.* TO 'monty'@'%' WITH GRANT OPTION;
CREATE USER 'admin'@'localhost';
GRANT RELOAD,PROCESS ON *.* TO 'admin'@'localhost';
CREATE USER 'dummy'@'localhost';
FLUSH PRIVILEGES;
谢谢您的帮助
答案1
尝试
GRANT SUPER ON *.* to user@localhost
或者,您可以连接到 mysql 数据库并运行以下命令:
UPDATE mysql.user SET Super_Priv='Y' WHERE user='user1' AND host='%';
FLUSH PRIVILEGES
您遇到的问题是您正在数据库级别工作,您需要设置全局访问权限。请阅读这关联。