When inserting Chinese characters into Mysql, what is displayed? First of all, the reason is that the consistent answer on the internet is that the character set does not match each other. You only need to change the character set in the same way. I spent two afternoons to get the modification steps. 1. Set the connection statement in the program: Stringurljdbc: mysql: 127.0.0.1: 3306 drink
When inserting Chinese characters into Mysql, what is displayed? First of all, the reason is that the consistent answer on the internet is that the character set does not match each other. You only need to change the character set in the same way. I spent two afternoons to get the modification steps. 1. Set the connection statement in the program: String url = "jdbc: mysql: // 127.0.0.1: 3306/drink
When inserting Chinese characters into Mysql, what is displayed? No.
The reason is that the consistent answer on the internet is that the character set is not compatible.
The reason is simple. You only need to change the character set in the same way.
I spent two afternoons to get the modification steps.
First, set the connection statement in the program: String url = "jdbc: mysql: // 127.0.0.1: 3306/drink_manage? UseUnicode = true & characterEncoding = UTF8 ";
Second, the character set of the database is utf8, and the character set of each table is also utf8.
Third: In c: // program files/mysql/my, when ini opens this configuration file, the default-character-set? To utf8 to save the file.
4. Open the mysql client. Enter show variables like 'Char % '; to check the character set settings.
Besides character_set_server? The value of character_set_database is latin, and the value of character_set_filesystem is binary. All other values are utf8. My problem is solved here. As for how to set the server and database character sets, I did not go deep into it. If I know anything, I can tell you.
The following are several mysql commands:
(1): show? Variables? Like? 'Char % ';
(2): \ s;
(3): set? Character_set_server = utf8; // This character set modification method cannot be saved after mysql is restarted.
The above are some experiences, which may not be suitable for all people. But if you want to change it, you can definitely change it.