??????????????:
????????:CREATE USER ' username'@'host ' IDENTIFIED BY 'password';
???????:username - ??????????????? host - ?????????????????????????????????????????localhost?? ???????????????????????????????????????????%. password - ????????????????????????????????????????????????????????.
????????: CREATE USER ' dog'@'localhost ' IDENTIFIED BY '123456';
????CREATE USER ' pig'@'192.168.1.101 _' IDENDIFIED BY '123456';
????CREATE USER ' pig'@'% ' IDENTIFIED BY '123456';
????CREATE USER 'pig'@'%' IDENTIFIED BY '';
????CREATE USER 'pig'@'%' ;
???????????:
????????:GRANT privileges ON databasename.tablename TO 'username'@'host'
???????: privileges - ??????????????SELECT ?? INSERT ?? UPDATE ??(????б?????????).????????????????????ALL .;databasename - ?????????tablename-???????????????????????????????????????????????*????? ??*.*.
????????: GRANT SELECT?? INSERT ON test.user TO 'pig'@'%' ;
????GRANT ALL ON *.* TO 'pig'@'%' ;
???????:?????????????????????????????????????????????????????????????????:
????GRANT privileges ON databasename.tablename TO 'username'@'host' WITH GRANT OPTION ;
????????????????????????
????????:SET PASSWORD FOR 'username'@'host' = PASSWORD('newpassword'); ???????????????SET PASSWORD = PASSWORD("newpassword");
????????: SET PASSWORD FOR 'pig'@'%' = PASSWORD("123456");
?????????????????
????????: REVOKE privilege ON databasename.tablename FROM 'username'@'host' ;
???????: privilege?? databasename?? tablename - ????????.
????????: REVOKE SELECT ON *.* FROM 'pig'@'%' ;
???????: ????????????'pig'@'%' ????????????????(???????):GRANT SELECT ON test.user TO 'pig'@'%' ?? ???????REVOKE SELECT ON *.* FROM 'pig'@'%' ;??????????????????test???????user???SELECT ????.????????????????GRANT SELECT ON *.* TO 'pig'@'%' ;??REVOKE SELECT ON test.user FROM 'pig'@'%' ;???????????????????test???????user???Select ???.
?????????????????????SHOW GRANTS FOR 'pig'@'%' ; ??.
?????塢??????
????????: DROP USER 'username'@'host' ;