Heim  >  Fragen und Antworten  >  Hauptteil

Es gibt kein Problem mit der MySQL-Konfiguration, aber Chinesisch wird nicht angezeigt.

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

吴勇文吴勇文2268 Tage vor1260

Antworte allen(2)Ich werde antworten

  • 天忆

    天忆2018-08-28 16:05:48

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

    Antwort
    0
  • 吴勇文

    非常感谢,已解决

    吴勇文 · 2018-08-28 23:26:01
  • StornierenAntwort