mysql:一些常用但是我记不住的命令

1、刷新

flush privileges;

2、设置root密码(5.7)

UPDATE mysql.user SET authentication_string = PASSWORD('密码') where User = 'root';
flush privileges;

设置成功后登陆报错
You must reset your password using ALTER USER statement before executing this statement.

SET PASSWORD = PASSWORD('密码');
ALTER USER 'root'@'localhost' PASSWORD EXPIRE NEVER;
flush privileges;

3、创建用户(5.7)

create user 'user'@'localhost' identified by '密码';

授权

grant all privileges on DBNAME.* to 'user'@'localhost' identified by '密码';


标签:暂无标签
版权属于:瑶玲OvO 所有,转载请注明文章来源。

本文链接: https://www.linmy.cn/index.php/%E5%85%B6%E4%BB%96/24.html

赞 (0)

评论区

发表评论

字数
0
/200
35+43=?

暂无评论,要不来一发?

回到顶部