12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
ADADADADAD
mysql数据库 时间:2024-11-29 10:11:53
作者:文/会员上传
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
Mysql设置用户指定ip地址操作数据库的方法:使用grant函数,语法为【grant priv_type on mysql.user to 'user'@'host' identified by 'password' with
以下为本文的正文内容,内容仅供参考!本站为公益性网站,复制本文以及下载DOC文档全部免费。
Mysql设置用户指定ip地址操作数据库的方法:使用grant函数,语法为【grant priv_type on mysql.user to 'user'@'host' identified by 'password' with】。
Mysql设置用户指定ip地址操作数据库的方法:
语法:
grant priv_type on mysql.user to 'user'@'host' identified by 'password' with grant option;
priv_type:代表允许操作数据库的权限
user:代表数据库用户名
host:代表IP地址
password:代表设置的密码
刷新user权限表:flush privileges;
三、案例
1、设置所有数据库、所有表、任意ip可以连接数据库,授权给用户名ping并设置密码为123456
grant all on *.* to 'ping'@'%' identified by '123456';flush privileges;
2、授权表cloud的记录修改权限给连接ip地址是192.168.100.1和用户名是ping并且密码为123456
grant update(name,sex) on cloud to 'ping'@'192.168.100.1' identified by '123456';flush privileges;
四、查看数据库权限表
mysql> select * from mysql.user where host='localhost'\G;*************************** 1. row *************************** Host: localhost User: Password:Select_priv: NInsert_priv: NUpdate_priv: NDelete_priv: NCreate_priv: NDrop_priv: NReload_priv: NShutdown_priv: N Process_priv: NFile_priv: N Grant_priv: NReferences_priv: N Index_priv: N Alter_priv: N Show_db_priv: N Super_priv: NCreate_tmp_table_priv: N Lock_tables_priv: N Execute_priv: NRepl_slave_priv: N Repl_client_priv: N Create_view_priv: N Show_view_priv: NCreate_routine_priv: N Alter_routine_priv: N Create_user_priv: N Event_priv: N Trigger_priv: N ssl_type: ssl_cipher:x509_issuer: x509_subject:max_questions: 0max_updates: 0max_connections: 0 max_user_connections: 0
11-20
11-19
11-20
11-20
11-20
11-19
11-20
11-20
11-19
11-20
11-19
11-19
11-19
11-19
11-19
11-19