1.mysql>CREATE USER 'user1'@'localhost' IDENTIFIED BY 'pass1';
2.mysql>GRANT SELECT,INSERT,UPDATE,DELETE ON *.* TO 'user1'@'localhost';
OR
mysql>GRANT ALL ON *.* TO 'user1'@'localhost';
If you think the method above is so difficult that you can't accept, you can use the method below:
mysql>GRANT ALL ON *.* TO 'user2'@'localhost' IDENTIFIED BY 'pass1';
And there is another direct method that you can have a try!
mysql>INSERT INTO user (Host,User,Password,Select_priv,Insert_priv)
VALUES('localhost','user4',PASSWORD('pass3'),'Y','Y');
本文介绍如何在MySQL中创建用户并授予不同级别的权限,包括通过SQL命令直接操作以及使用内置的user表进行插入记录的方式。

被折叠的 条评论
为什么被折叠?



