在mysql中快速添加用户并授权只需要如下两步
需求
- 添加用户nichao
- 登录密码设置为nichao
- 仅仅允许本机localhost登录
- 使nichao用户拥有testDB数据中的所有权限
方案
基于如上需求,可以通过如下sql 语句快速完成
grant all privileges on testDB.* to nichao@localhost identified by 'nichao';
flush privileges;
需求
方案
基于如上需求,可以通过如下sql 语句快速完成
grant all privileges on testDB.* to nichao@localhost identified by 'nichao';
flush privileges;