Mysql授权语句
Mysql授权使用
grant all privileges on *.* to 'root'@'%' identified by '123456' with grant option
- 其中
all privileges
指所有权限 *.*
中第一个*
是哪个数据库,如果为*
指所有数据库,第二个*
指选中库的哪个表,为*
指所有表root
指用户名%
指授权地址,%
指所有地址,localhost
指本地,也可以为127.0.0.1
123456
为设定密码with grant option
这个选项表示该用户可以将自己拥有的权限授权给别人
Mysql5.7修改密码
alter user 'root'@'localhost' identified by '123456'
修改root
本地密码为123456