This is the statement for creating a table in my database
This is a garbled picture of my database query. What is the reason?
给我你的怀抱2017-05-18 10:56:52
Assume you are using Windows command line. The default encoding of the Windows command line is GBK, and the content stored in MySQL is encoded in UTF-8, so it will be garbled when displayed.
List 3 solutions:
Specify the encoding for connecting to MySQL:
> mysql.exe -uroot -p --default-character-set=gbk
Specify the MySQL encoding after connecting:
mysql> set names gbk;
Modify Windows command line character encoding to UTF-8:
> chcp 65001
仅有的幸福2017-05-18 10:56:52
Look at what the sorting rules were when you created the database. Set it to this and try it utf8_general_ci
習慣沉默2017-05-18 10:56:52
Unify the encoding rules of the database to utf-8 and it should be fine
曾经蜡笔没有小新2017-05-18 10:56:52
First check whether the encoding format of your database is utf-8, if not, change it to utf-8
PHP中文网2017-05-18 10:56:52
Let me ask, is your terminal a terminal under Linux or a command line under Windows? The default under Windows is GBK, which is of course gibberish
ringa_lee2017-05-18 10:56:52
The Linux system you are using does not support Chinese. . . Just set it up to support Chinese. . .