|
1. The url parameter in the Connection of jdbc: jdbc:mysql://localhost/DATABASE_NAME?useUnicode=true&characterEncoding=UTF-8,
Among them, "useUnicode=true&characterEncoding=UTF-8" is there, if not, add it.
2. When creating a database:
create database DATABASE_NAME DEFAULT CHARACTER SET utf8;
Among them: "DEFAULT CHARACTER SET utf8" should be added, which means that all tables and fields (char, varchar) under the database DATABASE_NAME default to utf8.
In addition, if you look at mysql, is it in the command line state under linux or under MySQL Query Brower?
If you look at the Linux command line, most of them will be garbled. If the MySQL Query Brower is garbled, just change it according to the above 2 points. |
|