欢迎您来到,李雷博客 | PHP博客        登录  |  注册

新安装mysql报错1251 client does not support

更新:2021-12-08 19:41:28
人气:1429
来源:本站原创
A+

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

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

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

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

或者执行查看数据库:

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.MYSQL之后直接修改密码

mysql -uroot -p
输入密码:2.a!yNasp8Dn
执行
alter user user() identified by "88888888"

2.修改用户密码

ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '88888888';
更新user为root,host为% 的密码为88888888

一般先用下面的:localhost本地

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '88888888';
更新user为root,host为localhost 的密码为88888888

3.查看用户信息
select host,user,plugin,authentication_string from mysql.user;

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

推荐的文章
# 发表我的评论
  /     /  
# 最近评论
暂时还没有评论,要不要说点什么?
  Ads by Google
  联系博主
Hello,本博客系统采用PHP和MySql开发,程序开发完全是因为个人爱好,是自己纯手写PHP源代码,未采用任何PHP框架!
QQ:858353007   微信号:lileihot123
网站地图
会员服务
关于我们
QQ:858353007
 
广告服务
加我微信
移动端访问
 
 
Copyright © 2014- 2024 www.mdaima.com All Rights Reserved.
李雷博客,专注PHP经验、PHP教程及PHP源代码开源下载分享的PHP博客!   ICP备案号:京ICP备10202169号-4