ssh2 integration into the database garbled

Today, a friend asked me about the problem of storing Chinese garbled characters in the database.

As shown in the figure:

I took a look at his project, and everything from the page to the project to the server is in utf-8 format, so I guess the database encoding is incorrect. Checking the database encoding, it is not utf-8.

then change the encoding



Originally I thought it was over here , but it didn't  , and his database connection method was not utf-8 by default. But his xml url configuration is the simplest " jdbc:mysql://localhost:3306/xxx " .Innocent cry

I just.... So if you don't change the database, you can only modify the url first and change it to " jdbc:mysql://localhost:3306/xxx?useUnicode=true&characterEncoding=UTF-8 ", everything will be fine.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326441778&siteId=291194637