Mysql授权语句

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

猜你喜欢

转载自blog.csdn.net/qq_39309714/article/details/85159095