There is no problem with mysql configuration, but Chinese is not displayed;
吴勇文
吴勇文 2018-08-27 23:55:00
0
2
1202

mysql> show variables like "%colla%";
---------------------- -----------------
| Variable_name | Value |
---------------------- -----------------
| collation_connection | utf8_general_ci |
| collation_database | utf8_general_ci |
| collation_server | utf8_general_ci |
---------------------- -----------------

mysql> show variables like "%char%";
-------------------------- -----------------------------------------------
| Variable_name | Value |
-------------------------- -----------------------------------------------
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | C:\phpStudy\PHPTutorial\MySQL\share\charsets\ |
-------------------------- -----------------------------------------------

mysql> create table 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;
Query OK, 0 rows affected (0.03 sec)

QQ图片20180827235422.png

吴勇文
吴勇文

加油!努力!奋斗!

reply all (1)
天忆

Because the character encoding of the cmd command line is gbk, so what you insert is gbk encoded data, and your table is utf8 encoded, so the insertion will be garbled. You can try to build a gbk encoded data table and execute set names gbk;Then insert data into the command line

  • reply Thank you very much, solved
    吴勇文 author 2018-08-28 23:26:01
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!