MySQL问题汇总

这篇博客介绍了两种常见的MySQL连接错误:一是由于字符集不匹配导致的`Unknowninitialcharactersetindex'255'receivedfromserver`,解决方案是在jdbc.properties文件中修改URL,添加`characterEncoding=utf8`;二是`Clientdoesnotsupportauthenticationprotocolrequestedbyserver`,这可能是因为MySQL客户端版本过低,解决方法是使用SQL命令更新用户认证协议。详细步骤和原因解析一并提供。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

问题:Mysql:Unknown initial character set index ‘255’ received from server

原因:使用的字符集不同

解决方案:

​ 修改 jdbc.properties 文件中的url

url=jdbc:mysql://localhost:3306/xxxxx?characterEncoding=utf8

xxxx为项目名,只需要在项目名后修改编码方式为utf8即可

问题:Mysql:Client does not support authentication protocol requested by server; consider upgrading MySQL client

解决方案:

ALTER USER 'username'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
flush privileges;

这里username填使用的用户名

localhost填数据库的访问地址

password填当前数据库的登录密码

原因详见:[MySQL 8.0 - Client does not support authentication protocol requested by server; consider upgrading MySQL client

问题:Mysql:RuntimeError: Target host is configured as windows, but seems to be a different OS. Please review the connection settings

解决方案:

image-20211023160154379

打开后点击

image-20211023160241734

image-20211023160344952

image-20211023160401861

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Smile Hun

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值