minggehenhao 2020-03-23
Mysql的版本是8.0.18,其他版本未验证
// 切换数据库到mysql mysql> use mysql // testUser:新增的用户名;localhost:仅本地访问,也可以是%(不限制)或者ip地址;123456:用户密码 mysql> create user ‘testUser‘@‘localhost‘ identified by ‘123456‘;
mysql> flush privileges;
mysql> grant all privileges on *.* to ‘testUser‘@‘localhost‘ with grant option;
mysql> select Host,User from user;