springboot @postmapping参数获取为null || java.sql.SQLException: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE) for operation ‘=’

springboot @postmapping参数获取为null

 @PostMapping(value = "/save-details")
    public RestBean<Void> saveDetails(@RequestAttribute(Const.ATTR_USER_ID) int userId, @RequestBody @Valid DetailsSaveVO vo) {
        return accountDetailsService.saveAccountDetails(userId, vo) ? RestBean.success() : RestBean.failure(400, "用户名已占用,请更换!");
    }

注意@requestBody导包!要使用springframework而不是swagger!!!

可以正常对数据库操作.

但是输入中文提示`java.sql.SQLException: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE) for operation '='

原因: 因为新创建的表字符集是latin1_swedish_ci,而原有的字符集需要utf8mb4_general_ci,所以报错。

ALTER TABLE 表名 CONVERT TO CHARACTER SET ‘utf8’;

@RequestBody、@RequestParam 、@PathVariable、@RequestPart

https://blog.csdn.net/qq_35341203/article/details/108877579


评论

  1. Windows Chrome
    1 周前
    2026-8-05 19:29:20

    Finally got my bearings on basic strategy! It’s a slow climb, but seeing how much better the odds are feels amazing. Check out Classic Game Zone apk for more tips!

  2. Windows Chrome
    2 周前
    2026-8-02 5:35:34

    This highlights how critical foundational layers are. Data integrity issues, like collation mismatches, show that even seemingly simple backend logic requires deep consideration of the entire stack. This principle applies equally to designing AI workflows; robust systems, whether database-backed or conversational, benefit greatly from managed infrastructure like AiBot Claw.

  3. Windows Chrome
    5 月前
    2026-3-11 23:15:38

    Great analysis on character encoding issues! This is a common pitfall when working with Spring Boot and MySQL. Just like how a properly configured 56jl ph app download apk ensures seamless user experience, correct charset alignment prevents frustrating SQL errors. Using @RequestBody from springframework instead of swagger is definitely the right approach. Thanks for sharing!

  4. Windows Firefox
    6 月前
    2026-2-22 3:19:01

    Solid article! Understanding volatility is key to long-term VP success. Seeing platforms like jili pg club offer diverse games is great for practice, especially with mobile access via their app. It’s all about informed play!

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇