Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nacos2.5.1无法使用mysql8.4.4 #13176

Open
fuyuehua09 opened this issue Mar 11, 2025 · 2 comments
Open

nacos2.5.1无法使用mysql8.4.4 #13176

fuyuehua09 opened this issue Mar 11, 2025 · 2 comments

Comments

@fuyuehua09
Copy link

修改密码是包错误如下:

Image

caused: PreparedStatementCallback; SQL [UPDATE users SET password = ? WHERE username=?]; Buffer length is less than expected payload length.; nested exception is java.sql.SQLException: Buffer length is less than expected payload length.;caused: Buffer length is less than expected payload length.;caused: Buffer length is less than expected payload length.;

@KomachiSion
Copy link
Collaborator

我没有mysql8.4的环境, 只有8.0和 5.7环境, 在这两个环境下使用没问题, 是新版本mysql 不支持旧版本驱动吗?

简单的UPDATE语句应该不至于不支持吧。

Image

@KomachiSion
Copy link
Collaborator

咨询了DS, 反馈说可能的问题有:

数据长度超过列定义:

password 字段的值(例如加密后的值)长度超过了数据库表中定义的 VARCHAR 或 BLOB 列的最大长度。

JDBC 连接参数缺失:

未正确配置 SSL 或字符编码参数(如 useSSL、characterEncoding),导致驱动无法正确处理数据缓冲区。

驱动版本不兼容:

MySQL 8.4.x 需要较新的 JDBC 驱动版本(如 mysql-connector-java:8.0.x),旧版本驱动可能引发此问题。

二进制数据截断:

如果 password 字段存储的是二进制数据(如加密后的字节数组),可能会因缓冲区长度不足导致异常。

结合我环境中5.7和8.0的mysql server可用,有可能是您建表的时候的字段长度设置错误, 可以通过alter table修改。

如果表结构没有问题, 那么可能是数据库设置问题导致缓冲区长度不足,或mysql 8.4.4不兼容8.0的驱动(nacos使用的驱动版本应该是8.0.2x)那么就只能修改mysql server配置或者等待mysql修复不兼容的问题。

总的来说, 此问题应该和nacos的2.5.1版本无关。 欢迎您将后续的排查和解决结果更新到issue中。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants