MySQL????????????
???????????? ???????[ 2016/7/11 14:40:19 ] ????????????? MySQL
??????????????:
????????: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' ;
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11