复制本文链接

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');

阿里云老用户专享阿里云双12

发表评论

电子邮件地址不会被公开。 必填项已用*标注

− 2 = 8