1 . 进入数据库,查看用户
想要查看用户,须先进入mysql数据库中
use mysql; #先进入
select user,authentication_string,host from user; #查看用户
.
.
2 . create user ‘test01‘@‘localhost‘ identified by ‘123123‘; #创建用户及密码
grant all on . to ‘test02‘@‘localhost‘ identified by ‘123123‘; #创建用户及密码,如果用户存在,则更改,若不在则新建
.
.
3 . 设置好用户与密码后也可以更改用户与密码
rename user ‘test01‘@‘localhost‘ to ‘user01‘@‘192.168.200.128‘;#重命名用户及主机
set password for ‘user02‘@‘localhost‘ = password(‘qwe123‘);# 更改用户密码