我装MYSQL时选的字符集是utf8
test表中只有一个字段varchar(20)类型,
insert into test values ('中文');
在控制台中执行会报错:无效的字符值。
请问这是为什么?
test表中只有一个字段varchar(20)类型,
insert into test values ('中文');
在控制台中执行会报错:无效的字符值。
请问这是为什么?
解决方案 »
- Can't send long data for non-string/non-binary data types
- mysql中的longtext问题
- 如何运用一些mysqladmin,flush-hosts实用程序
- 在vs2008下,编译出现了问题
- 这个sql语句该怎么写?
- 极其郁闷的MySQL出错问题(Table 'mysql.general_log' doesn't exit)
- MySQLDriverCS中文显示的问题
- PostgreSQL user defined function 错误排出,谢谢
- 源码 安装的mysql 创建innodb 类型的表 为何不支持 B-TREE 类型的索引??
- MYSQL写入或者读取速度慢 怎么解决呢 是固态硬盘。
- 求mysql存储过程详解
- mysql存储过程,求救!
麻烦指点一下,谢谢。
#
# The following options will be read by MySQL client applications.
# Note that only client applications shipped by MySQL are guaranteed
# to read this section. If you want your own MySQL client program to
# honor these values, you need to specify it as an option during the
# MySQL client library initialization.
#
[client]port=3306[mysql]default-character-set=latin1
# SERVER SECTION
# ----------------------------------------------------------------------不知道是不是这个.
贴结果
[client]port=3306[mysql]default-character-set=utf8
# 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="D:/Program Files/MySQL/MySQL Server 5.0/"#Path to the database root
datadir="D:/Program Files/MySQL/MySQL Server 5.0/Data/"# The default character set that will be used when a new schema or table is
# created and no character set is defined
default-character-set=utf8你的客户端程序也要使用utf8,一致
:-))试试看把你的代码添加为 batch 格式或其它格式