MySql不能输入中文之1366错误
来源:互联网 发布:手机登录淘宝卖家中心 编辑:程序博客网 时间:2024/05/16 00:54
mysql插入中文报错:incorrect string value:...
1、查看当前table的字符编码
show create table tname;确认为gbk或者utf8。
2、进入安装目录下的 my.ini修改配置,
有两个地方需要修改,一个是client端的还有一个是server端的
1. # CLIENT SECTION
2. # ----------------------------------------------------------------------
3. #
4. # The following options will be read by MySQL client applications.
5. # Note that only client applications shipped by MySQL are guaranteed
6. # to read this section. If you want your own MySQL client program to
7. # honor these values, you need to specify it as an option during the
8. # MySQL client library initialization.
9. #
10. [client]
11. port=3306
12. [mysql]
13. default-character-set=gbk
13. #default-character-set=utf8
14.
15. # SERVER SECTION
16. # ----------------------------------------------------------------------
17. #
18. # The following options will be read by the MySQL Server. Make sure that
19. # you have installed the server correctly (see above) so it reads this
20. # file.
21. #
22. [mysqld]
23. # The TCP/IP Port the MySQL Server will listen on
24. port=3306
25.
26. #Path to installation directory. All paths are usually resolved relative to this.
27. basedir="C:/Program Files/MySQL/MySQL Server 6.0/"
28. #Path to the database root
29. datadir="C:/Program Files/MySQL/MySQL Server 6.0/Data/"
30. # The default character set that will be used when a new schema or table is
31. # created and no character set is defined
32. default-character-set=gbk
32. #default-character-set=utf8
还要在创建数据库的时候 指定 default charset=gbk
创建表的时候最好也加上。
create table data(
id int primary key auto_increment,
sid varchar(256) not null,
name varchar(256) not null,
longitude decimal(10,6) not null,
latitude decimal(9,6) not null,
jam_level integer(1) not null,
description text,
insert_time timestamp not null,
update_time timestamp not null
)default charset=gbk
按以上操作后,中文可以插入mysql数据库中了(最好此时重启下mysql服务:net stop mysql,net start mysql)。
1、查看当前table的字符编码
show create table tname;确认为gbk或者utf8。
2、进入安装目录下的 my.ini修改配置,
有两个地方需要修改,一个是client端的还有一个是server端的
1. # CLIENT SECTION
2. # ----------------------------------------------------------------------
3. #
4. # The following options will be read by MySQL client applications.
5. # Note that only client applications shipped by MySQL are guaranteed
6. # to read this section. If you want your own MySQL client program to
7. # honor these values, you need to specify it as an option during the
8. # MySQL client library initialization.
9. #
10. [client]
11. port=3306
12. [mysql]
13. default-character-set=gbk
13. #default-character-set=utf8
14.
15. # SERVER SECTION
16. # ----------------------------------------------------------------------
17. #
18. # The following options will be read by the MySQL Server. Make sure that
19. # you have installed the server correctly (see above) so it reads this
20. # file.
21. #
22. [mysqld]
23. # The TCP/IP Port the MySQL Server will listen on
24. port=3306
25.
26. #Path to installation directory. All paths are usually resolved relative to this.
27. basedir="C:/Program Files/MySQL/MySQL Server 6.0/"
28. #Path to the database root
29. datadir="C:/Program Files/MySQL/MySQL Server 6.0/Data/"
30. # The default character set that will be used when a new schema or table is
31. # created and no character set is defined
32. default-character-set=gbk
32. #default-character-set=utf8
还要在创建数据库的时候 指定 default charset=gbk
创建表的时候最好也加上。
create table data(
id int primary key auto_increment,
sid varchar(256) not null,
name varchar(256) not null,
longitude decimal(10,6) not null,
latitude decimal(9,6) not null,
jam_level integer(1) not null,
description text,
insert_time timestamp not null,
update_time timestamp not null
)default charset=gbk
按以上操作后,中文可以插入mysql数据库中了(最好此时重启下mysql服务:net stop mysql,net start mysql)。
- MySql不能输入中文之1366错误
- mysql 不能插入中文的1366错误
- 为什么mysql不能输入中文?
- LINUX下mysql客户端不能输入中文
- MySQL Workbench不能输入中文的解决
- MySql中文乱码错误 mysql error 1366 incorrect string value 不能插入中文字符
- mysql进阶(二十二)MySQL错误之Incorrect string value: '\xE7\x81\xAB\xE7\x8B\x90...中文字符输入错误
- MySQL Query Browser不能输入中文和英文字符
- 控制台不能输入中文
- 验证 不能输入中文
- word不能输入中文
- scratch 不能输入中文
- MicrosoftOffice2010不能输入中文
- Myeclipse不能输入中文
- Myeclipse不能输入中文
- Ubuntu ibus 输入法之Skype不能输入中文
- Android开发之旅一EditText不能输入中文
- Ubuntu下进入mysql,在终端下不能输入中文,直接是不能键入
- 黑马程序员类集框架中的接口和实现
- 当前的安全设置不允许从该位置下载文件
- 黑马程序员映射
- UML 的简单用法
- .NET DataTable转化为json格式
- MySql不能输入中文之1366错误
- 黑马程序员反射和代理模式
- 442 - Matrix Chain Multiplication
- ubuntu 安装svn
- 常用的webservice接口(二)
- 使用LitJSON.dll处理json格式的数据示例
- 黑马程序员线程
- 用U盘装Ubuntu系统(ISO文件)
- 求数组两两之差绝对值最小的值