标签:class 不能 code 修改 功能 通过 grant png rev
::1表示ip结尾是1的能通过root用户来访问这台机器的数据库
创建用户
CREATE USER ‘woaiwenmeng‘@‘127.0.0.1‘ IDENTIFIED BY ‘123‘
查看用户权限
SHOW GRANTS FOR ‘woaiwenmeng‘@‘127.0.0.1‘;
授权
GRANT SELECT,UPDATE ON db1.info1 TO ‘woaiwenmeng‘@‘127.0.0.1‘;
授权了查询和修改功能,未授权的不能执行
有以下权限:
GRANT ALL PRIVILEGES ON *.* TO ‘woaiwenmeng‘@‘127.0.0.1‘;#授予除了grant权限之外的所有权限
取消授权
REVOKE ALL PRIVILEGES ON *.* FROM ‘woaiwenmeng‘@‘127.0.0.1‘;#To变成了FROM 从指定用户下移除当前用户的所有授权
移除用户
DROP USER ‘woaiwenmeng‘@‘127.0.0.1‘;
修改用户
RENAME USER ‘woaiwenmeng‘@‘127.0.0.1‘ TO ‘wenmeng‘@‘192.168.0.1‘;
局域网连接测试:
CREATE USER ‘test‘@‘%‘ IDENTIFIED BY ‘123456‘;#%表示所有的ip GRANT ALL PRIVILEGES ON *.* TO ‘test‘@‘%‘; FLUSH PRIVILEGES; #刷新权限
标签:class 不能 code 修改 功能 通过 grant png rev
原文地址:https://www.cnblogs.com/start20180703/p/10326599.html