To directory <http://www.cnblogs.com/lori/p/7154409.html>

stay dotnetcore in , connect mysql data , Unrecognized while inserting Chinese , And prompt the insertion failure , After analysis, it is known that it is a coding problem , That is, database coding , Your Chinese is not recognized in the data table !

resolvent ( One )

conduct mysql Console
mysql -u root -p
Execute the following statement
set character_set_client = utf8; set character_set_server = utf8; set
character_set_connection = utf8; set character_set_database = utf8; set
character_set_results = utf8; set collation_connection = utf8_general_ci; set
collation_database = utf8_general_ci; set collation_server = utf8_general_ci;
resolvent ( Two )

Set up the database or modify the code of the database to utf8 that will do
create database dbname character set utf8; The command to modify the database code is : alter database dbname
character set utf8;
resolvent ( Three )

modify mysql configuration file , Then restart mysql That's enough
vi /etc/my.cnf -- stay [mysqld] Add the following under the label : default-character-set = utf8
character_set_server = utf8 -- stay [mysql] Add a line under the label default-character-set = utf8
-- stay [mysql.server] Add a line under the label default-character-set = utf8 -- stay [mysqld_safe] Add a line under the label
default-character-set = utf8 -- stay [client] Add a line under the label default-character-set = utf8
I hope this article can help you !
To directory <http://www.cnblogs.com/lori/p/7154409.html>