Solve the problem that the Chinese garbled under MySQL is all question mark
is also a headache of Chinese garbled problem, just start I have been using the local database test, this is no problem ah, not a problem, but I forget the Android and the Web is the server on my database, measured a bit, really garbled.
Try a lot of methods on the Internet, although do not know exactly which method to set up, you have to say it
The first of these methods
Just start checking the MySQL database, found that, as the web said, part of the code is Latin1, is the following:
Change decisively.
Set Character_set_client=utf8;
Set Character_set_connection=utf8;
Set Character_set_database=utf8;
Set Character_set_results=utf8;
Set Character_set_server=utf8;
Set Character_set_system=utf8;
After the change is finally utf8, but measured, or not ...
The second method
Because I used the Tencent cloud server, the system is Linux server, so only to say that the modified Linux method
Modify/ETC/MYSQL/MY.CNF This file, add the following code in the corresponding place OK
[Client]
Port = 3306
socket =/var/lib/mysql/mysql.sock
Default-character-set=utf8
[mysqld]
port = 3306
Socket =/var/lib/mysql/mysql.sock
Character-set-server=utf8
[MySQL]
no-auto-rehash
After restarting the database, it solves the garbled problem perfectly.
Thank you for reading, I hope to help you, thank you for your support for this site!