将用户(拥有所有管理员权限)的所有权限授予其他用户

时间:2016-11-30 07:52:10

标签: mysql

我已执行以下命令来创建新用户

CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost';
FLUSH PRIVILEGES;

现在我退出了Mysql。我再次使用" newuser"

进入mysql终端

然后我再次创建了具有以下命令的新用户

CREATE USER 'newuser2'@'localhost' IDENTIFIED BY 'password';
    GRANT ALL PRIVILEGES ON * . * TO 'newuser2'@'localhost';
    FLUSH PRIVILEGES;

返回以下错误

mysql> grant all privileges on *.* to newuser2@localhost identified by 'pass' with grant option;
ERROR 1045 (28000): Access denied for user 'newuser'@'localhost' (using password: YES)

0 个答案:

没有答案