Es gibt kein Problem mit der MySQL-Konfiguration, aber Chinesisch wird nicht angezeigt.
吴勇文
吴勇文 2018-08-27 23:55:00
0
2
1267

mysql> Variablen wie „%colla%“ anzeigen;
+-------------------------------------+---------------- -+
| Variablenname        | Wert           |
+------------------------------------+-----------------+
| collation_connection | utf8_general_ci |
| collation_database   | utf8_general_ci |
| collation_server     | utf8_general_ci |
+-------------------------------------+-----------------+

mysql>  Variablen wie „%char%“ anzeigen;
+--------------------------+------------ -----------------------------------+
| Variablenname            | Wert                                        |
+--------------------------+------------------- -------------+
| Character_set_client     | utf8                                         |
| Zeichensatz_Verbindung | utf8                                         |
| Character_set_database   | utf8                                         |
| zeichensatz_dateisystem | binär                                       |
| Character_set_results    | utf8                                         |
| Character_set_server     | utf8                                         |
| Character_set_system     | utf8                                         |
| Character_sets_dir       | C:phpStudyPHPTutorialMySQLsharecharsets |
+----------------------------------------+----------------- ---------------+

mysql> Tabelle erstellen emp3(
    ->   `id` int(11) NOT NULL AUTO_INCREMENT,
    ->   `username` varchar(50) NOT NULL,
    ->   `balance` float NOT NULL,
    ->   `province ` varchar(20) NOT NULL,
    ->   `age` tinyint(3) unsigned NOT NULL,
    ->   `sex` tinyint(4) NOT NULL,
    ->   PRIMARY KEY (`id`)
    - > ) ENGINE=InnoDB CHARSET=utf8;
Abfrage OK, 0 Zeilen betroffen (0,03 Sek.)

QQ图片20180827235422.png

吴勇文
吴勇文

加油!努力!奋斗!

Antworte allen(1)
天忆

因为cmd命令行的字符编码是gbk,所以你插入的是gbk编码的数据,而你的表是utf8编码,所以插入会乱码,你可以试建一个gbk编码的数据表,执行set names gbk;然后再命令行里插入数据

  • Antwort 非常感谢,已解决
    吴勇文 Autor 2018-08-28 23:26:01
Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage