- show databases; #查询库表
- use dataplatform; #进入数据库
- show tables; #查询表
- truncate table wp_comments;# 清空表, wp_comments, 清空的表名.
- source /root/test.sql; # 导入数据
报错:
- mysql> source /root/test.sql;
- ERROR 1366 (HY000): Incorrect string value: '\xC9\xCF\xBA\xA3\xCA\xD0...' for column 'address' at
- row 1
- ERROR 1366 (HY000): Incorrect string value: '\xC9\xCF\xBA\xA3\xCA\xD0...' for column 'address' at
- row 1
- ERROR 1366 (HY000): Incorrect string value: '\xC9\xCF\xBA\xA3\xCA\xD0...' for column 'address' at
- row 1
- ERROR 1366 (HY000): Incorrect string value: '\xC9\xCF\xBA\xA3\xCA\xD0...' for column 'address' at
- row 1
解决方法:
set names gbk;
来源: http://www.bubuko.com/infodetail-2653033.html