码迷,mamicode.com
首页 > 数据库 > 详细

mysql

时间:2018-11-22 20:46:00      阅读:217      评论:0      收藏:0      [点我收藏+]

标签:comment   rmi   rar   code   error   app   ase   system   object   

https://blog.csdn.net/dc_726/article/details/9209429
http://hunan.iteye.com/blog/752606

1.SQL上
用以下命令导出TicketInfo表的查询结果
BCP "select * from CyberArk.dbo.T_CyberArkTicketing_TicketsInformation" queryout "C:\test.csv" -c -t , -S "." -T

2.MYSQL上
[root@ChrisTest downloads]# mysql -uroot -p

mysql> CREATE DATABASE IF NOT EXISTS EVD DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;

mysql> USE EVD;


这里有一段需要附加

mysql> DESCRIBE T_CyberArkTicketing_TicketsInformation;

mysql> LOAD DATA INFILE "/root/downloads/T_CyberArkTicketing_TicketsInformation.csv" INTO TABLE T_CyberArkTicketing_TicketsInformation CHARACTER SET utf8;
ERROR 13 (HY000): Can‘t get stat of ‘/root/downloads/T_CyberArkTicketing_TicketsInformation.csv‘ (Errcode: 13)

mysql> LOAD DATA LOCAL INFILE "/root/downloads/T_CyberArkTicketing_TicketsInformation.csv" INTO TABLE T_CyberArkTicketing_TicketsInformation CHARACTER SET utf8;
Query OK, 100 rows affected, 900 warnings (0.00 sec)
Records: 100 Deleted: 0 Skipped: 0 Warnings: 900

导入成功,但发现全部都导入到TicketID这个字段里了,还带逗号分割。看来分割符号识别错误
mysql> DELETE FROM T_CyberArkTicketing_TicketsInformation;
清空表数据先。

mysql> LOAD DATA LOCAL INFILE "/root/downloads/T_CyberArkTicketing_TicketsInformation.csv" INTO TABLE T_CyberArkTicketing_TicketsInformation CHARACTER SET utf8 FIELDS TERMINATED BY ‘,‘;
Query OK, 100 rows affected (0.00 sec)
Records: 100 Deleted: 0 Skipped: 0 Warnings: 0

mysql> SELECT * FROM T_CyberArkTicketing_TicketsInformation\G
.
.
.
.
100. row
TicketID: B02-2018-11-02315
Applicant: jytian01
StartTime: 2018-11-20 08:30:00
EndTime: 2018-11-23 20:00:00
ObjectName: Operating System-WINServerLocal_S-10.116.29.20-administrator
FileID: 30
SafeName: ODS_SURP
SafeID: 85
CreationDate: 2018-11-19 15:11:09
Comment:
100 rows in set (0.00 sec)

mysql

标签:comment   rmi   rar   code   error   app   ase   system   object   

原文地址:http://blog.51cto.com/3229026/2320411

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!