Djangoフレームの下で文字の文字化けしを出力することを解決して、しかしMysqlの中で中国語の問題です

1009 ワード

Webページの文字化けしが発生したが、データベースに正常に表示されるという問題
Mysqlインストールディレクトリの下のmyを変更します.iniファイル内
[client]

port=3306

[mysql]

default-character-set=gbk


# SERVER SECTION
# ----------------------------------------------------------------------
#
# The following options will be read by the MySQL Server. Make sure that
# you have installed the server correctly (see above) so it reads this 
# file.
#
[mysqld]

# The TCP/IP Port the MySQL Server will listen on
port=3306


#Path to installation directory. All paths are usually resolved relative to this.
basedir="C:/Program Files/MySQL/MySQL Server 5.5/"

#Path to the database root
datadir="C:/ProgramData/MySQL/MySQL Server 5.5/Data/"

# The default character set that will be used when a new schema or table is
# created and no character set is defined
character-set-server=utf8

中は2つのcharacter-set-serverがあって、上のはgbkに変えて、下はutf 8に変えてそれからnet stop mysqlを入力して、MySQLを停止して更にMySQLを再起動して、net start mysqlは最後に更にデータベースを削除して更に表を建てて入力します