MySQL???????
???????????? ???????[ 2017/2/10 10:05:42 ] ????????????? ??????
??????????????mysql????????????????????:
????????????????壺
???????????????е???????????????????????????????????????????????и???????????????????????????????????????????????????ο???????????????????????????к?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????к?????????
????mysql????????????????????
????1??????????mysql??????????????
????2?????????Щ?????????磺select update ???
?????????mysql??????????????
????mysql?????????У??????????????????
????1???????????? host
????2??????? user
????3?????? password
????????mysql??????C:UsersPC003>mysql -h192.168.6.223 -uroot -pjalja
?????????????-h:??δ??????????
????-u??user
????-p??????
????mysql> select user??host??password from user;
????+------+-----------+-------------------------------------------+
????| user | host | password |
????+------+-----------+-------------------------------------------+
????| root | localhost | *CFAFE434FB0E5D64538901E668E1EACD077A54DF |
????| root | % | *CFAFE434FB0E5D64538901E668E1EACD077A54DF |
????+------+-----------+-------------------------------------------+
????host=localhost??????????????????????????C:UsersPC003>mysql -uroot -pjalja??C:UsersPC003>mysql -hlocalhost -uroot -pjalja??C:UsersPC003>mysql -h127.0.0.1 -uroot -pjalja??host=%????÷??????????????????????????(????)?????????????????????÷?????????????в????
????host=192.168.6.224????÷??????????192.168.6.224???????????? C:UsersPC003>mysql -h192.168.6.223 -uroot -pjalja
??????????host??
????mysql> update user set host='192.168.6.223' where user ='root'
????mysql> flush privileges;?????????????????????????????β????????????????????????£?
???????????
????mysql> update user set password=password('111111') where user='root';
????mysql> flush privileges;
????????mysql??ν????????
????mysql???????mysql??????user???????????????db????????????Щ??????Щ????????tables_priv????????????Щ??????Щ????????
??????????????????
????grant [???1?????2] on *.* to user@'host' identfied by 'password';
????????????all??create??drop??insert??delete??update??select
???????磺????ls??????п????б???????????????t????????????κ??????????
????mysql> grant all on *.* to 'ls'@'192.168.6.%' identified by '111111';
????????????????C:UsersPC003>mysql -h192.168.6.223 -uls -p111111;
??????ls???????????Щ????
????mysql> select * from mysql.user where user='ls' G;
????*************************** 1. row ***************************
????Host: 192.168.6.%
????User: ls
????Password: *FD571203974BA9AFE270FE62151AE967ECA5E0AA
????Select_priv: Y
????Insert_priv: Y
????Update_priv: Y
????Delete_priv: Y
????Create_priv: Y
????Drop_priv: Y
????Reload_priv: Y
????Shutdown_priv: Y
????Process_priv: Y
????File_priv: Y
????Grant_priv: N
????References_priv: Y
????Index_priv: Y
????Alter_priv: Y
????Show_db_priv: Y
????Super_priv: Y
????Create_tmp_table_priv: Y
????Lock_tables_priv: Y
????Execute_priv: Y
????Repl_slave_priv: Y
????Repl_client_priv: Y
????Create_view_priv: Y
????Show_view_priv: Y
????Create_routine_priv: Y
????Alter_routine_priv: Y
????Create_user_priv: Y
????Event_priv: Y
????Trigger_priv: Y
????Create_tablespace_priv: Y
????ssl_type:
????ssl_cipher:
????x509_issuer:
????x509_subject:
????max_questions: 0
????max_updates: 0
????max_connections: 0
????max_user_connections: 0
????plugin:
????authentication_string: NULL
??????????????ls?????????
????mysql> revoke all on *.* from ls@'192.168.6.%';
?????????????????
????mysql> grant all on blog.* to ls@'192.168.6.%';????ls??????blog??????????????
????????ls?????user????????????????????db??????????
????mysql> select * from mysql.db where user='ls' G;
????*************************** 1. row ***************************
????Host: 192.168.6.%
????Db: blog
????User: ls
????Select_priv: Y
????Insert_priv: Y
????Update_priv: Y
????Delete_priv: Y
????Create_priv: Y
????Drop_priv: Y
????Grant_priv: N
????References_priv: Y
????Index_priv: Y
????Alter_priv: Y
????Create_tmp_table_priv: Y
????Lock_tables_priv: Y
????Create_view_priv: Y
????Show_view_priv: Y
????Create_routine_priv: Y
????Alter_routine_priv: Y
????Execute_priv: Y
????Event_priv: Y
????Trigger_priv: Y
????????ls????????????????????????????ls???blog????user??crud???
????mysql> revoke all on *.* from ls@'192.168.6.%';
????Query OK?? 0 rows affected (0.00 sec)
????mysql> flush privileges;
????Query OK?? 0 rows affected (0.00 sec)
????mysql> grant insert??update??select??delete on blog.user to ls@'192.168.6.%';
????Query OK?? 0 rows affected (0.00 sec)
????mysql> flush privileges;
????Query OK?? 0 rows affected (0.00 sec)
????????ls?????db??????????????????????tables_priv?????????飺
????mysql> select * from mysql.tables_priv where user='ls' G;
????*************************** 1. row ***************************
????Host: 192.168.6.%
????Db: blog
????User: ls
????Table_name: user
????Grantor: root@localhost
????Timestamp: 2017-02-09 14:35:38
????Table_priv: Select??Insert??Update??Delete
????Column_priv:
????1 row in set (0.00 sec)
????mysql???????????
???????mysql??????????????????????
??????
???·???
??????????????????
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