新安装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;
第三步执行能看到数据库用户信息,此时再登录应该不会有问题了。
推荐的文章
随手记
PHP经验分享
- ● MySQLSUM在没有符合查询条件时返回结果为空的处理办法
- ● 如何开启PHP8的JIT提升运行速度
- ● 钉钉API接口-用PHP+Curl实现获取用户信息
- ● 钉钉API接口-用PHP+Curl实现获取应用Access_Token
- ● 在PHP中使用CURL,“撩”服务器只需几行——phpcurl详细解析和常见大坑
- ● MySQLInnodb并发涉及参数说明
- ● mysql参数调优之innodb_thread_concurrency、innodb_concurrency_tickets合理的使用cpu性能
- ● PHP用fsockopen检测指定IP端口是否开启可用
- ● PHP用socket检测服务器IP端口是否开放?代码示例
- ● GatewayWorker报错:Waring:Events::onMessageisnotcallable