日期:2014-05-16  浏览次数:20437 次

mysql utf8编码数据库设置

my.ini

中设置

[mysql]

?

#default-character-set=latin1

default-character-set=utf8

?

...

?

[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=latin1

character-set-server=utf8

?

创建

create database test default character set utf8 collate utf8_general_ci;

查看编码情况:

status;

?