你在my.ini的两个default-character-set=utf8都已经设为utf8了吗?
[client]port=3306default-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 4.1/"#Path to the database root
datadir="C:/Program Files/MySQL/MySQL Server 4.1/Data/"# The default character set that will be used when a new schema or table is
# created and no character set is defineddefault-character-set=utf8如果都设了,仍然不能变成你想要的结果,我想只能重装,在MySQl Server Instance Configuration Wizard
时候,装到要选择字符集,有三个单选按钮:第一个是默认的latin1;第二个是utf8;第三个是手工选择其他字符集,例如gbk,gb2312.如果你要建的数据库和表跟你mysql的默认字符集不一致,你可以设置一下.
DROP TABLE IF EXISTS `yinshi`.`cities`;
CREATE TABLE `cities` (
`cityid` int(4) NOT NULL auto_increment,
`CityName` varchar(10) NOT NULL default '',
PRIMARY KEY (`cityid`),
UNIQUE KEY `cityid` (`cityid`),
KEY `ID` (`cityid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
[client]port=3306default-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 4.1/"#Path to the database root
datadir="C:/Program Files/MySQL/MySQL Server 4.1/Data/"# The default character set that will be used when a new schema or table is
# created and no character set is defineddefault-character-set=utf8如果都设了,仍然不能变成你想要的结果,我想只能重装,在MySQl Server Instance Configuration Wizard
时候,装到要选择字符集,有三个单选按钮:第一个是默认的latin1;第二个是utf8;第三个是手工选择其他字符集,例如gbk,gb2312.如果你要建的数据库和表跟你mysql的默认字符集不一致,你可以设置一下.
DROP TABLE IF EXISTS `yinshi`.`cities`;
CREATE TABLE `cities` (
`cityid` int(4) NOT NULL auto_increment,
`CityName` varchar(10) NOT NULL default '',
PRIMARY KEY (`cityid`),
UNIQUE KEY `cityid` (`cityid`),
KEY `ID` (`cityid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
解决方案 »
- 合区并筛选
- Mysql的Select变量问题
- 从java向postgreSQL的接续问题
- 添加外键约束关系没有生成?
- mysql的主从问题 从服务器对数据库修改不会影响主的数据库么?
- ALTER TABLE a ADD aId INT(10) UNSIGNED DEFAULT '-1' 为什么失败
- mysql外键设置问题,触发事件ON DELETE 如何设置为SET DEFAULT
- mysql4的备份导入mysql5,出问题了
- 返回空集合的SQL 语句怎么写啊?
- Couldn't perform edit because another user changed the record
- ■■MYSQL不支持子查询吗??有的地方非要用到子查询怎么办???
- 超离奇的事件,大家给点意见
如果是命令界面是,可以在装的时候设定为utf-8就行了