MySQL:使用root权限创build用户
我想创build一个拥有root用户所有权限的用户,用户应该能够访问所有数据库,创build数据库,并且应该能够授予其他用户权限。
% mysql --user=root mysql 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;