alter user ‘root’@‘localhost’ idetntified with mysql_native_password by ‘password’;
alter user ‘root’@‘localhost’ idetntified by ‘password’ PASSWORD expire never;
alter user ‘root’@‘localhost’ identified by ‘password’;
flush privileges;
使得数据库中的密码算计改变。并重新赋值密码。只对当前用户有用。
当初老师给我发的sqlyog的时候,用的是远程连接,所以我的权限不够,只能增删改查,而不能增加用户和权限。我创建新的连接才发现这个问题。
以上方法是通过百度和实践得出的结果 亲测有用。我是mysql8.0。