mysql创建用户和修改非Root用户密码

1 创建用户

create user 'test'@'%' identified by '123456';

flush privileges;

2 赋予用户数据库权限

grant all privileges on `testdb`.* to 'test'@'%' identified by '123456';
flush privileges;

3 修改非Root用户密码

https://dev.mysql.com/doc/refman/5.7/en/resetting-permissions.html

1 MySQL 5.7.6 and later:

ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';

2 MySQL 5.7.5 and earlier:

SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPass');
赞 (0) 打赏

评论 0

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏