新安装mysql报错1251 client does not support

数据库   发布日期:2023年05月15日   浏览次数:536

MYSQL安装初始化之后有一个默认密码,如下2.a!yNasp8Dn

  1. A temporary password is generated for root@localhost: 2.a!yNasp8Dn

用Native客户端连接时报错:1251 client does not support,但是我们通过命令行是可以连接的,我们测试一下执行以下代码查看一下用户的信息:

  1. select host,user,plugin,authentication_string from mysql.user;

或者执行查看数据库:

  1. You must reset your password using ALTER USER statement before executing this statement.

可能以上两行查询指令都会返回提示:

You must reset your password using ALTER USER statement before executing this statement.

系统提示我们需要更改密码,那我们就说一下解决办法。


按如下步骤操作:

  1. 1.MYSQL之后直接修改密码
  2.  
  3. mysql -uroot -p
  4. 输入密码:2.a!yNasp8Dn
  5. 执行
  6. alter user user() identified by "88888888"
  7.  
  8. 2.修改用户密码
  9.  
  10. ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '88888888';
  11. 更新userroothost为% 的密码为88888888
  12.  
  13. 一般先用下面的:localhost本地
  14.  
  15. ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '88888888';
  16. 更新userroothostlocalhost 的密码为88888888
  17.  
  18. 3.查看用户信息
  19. select host,user,plugin,authentication_string from mysql.user;

第三步执行能看到数据库用户信息,此时再登录应该不会有问题了。

以上就是新安装mysql报错1251 client does not support的详细内容,更多关于新安装mysql报错1251 client does not support的资料请关注九品源码其它相关文章!