首页 > 代码库 > datafactory5.6向mysql5.7添加大量测试数据

datafactory5.6向mysql5.7添加大量测试数据

1.下载安装datafactory5.6

2.下载安装mysql5.7,并创建数据库guest_test和表sign_event

3.下载安装odbc5.3

4.打开datafactory配置数据源,如下流程图

技术分享

 

技术分享

 

技术分享

 

技术分享

 

技术分享

 

技术分享

 

技术分享

 

技术分享

技术分享

 

5.设置表的各个字段值规则与数据库对应,点击run,提示成功,查看sign_event表有新增的大量数据

 

遇到的几个问题:

1.最开始安装的是odbc3.5版本(32和64都装了),后来执行的时候提示成功,但是数据库没有新增数据

  解决:经过各种百度和n次尝试,怀疑是版本不匹配,3.5不行,然后又重新下载安装5.3版本64位的(因为我mysql装的是64位),但是安装后配置数据源时找不到odbc5.3;

     经过思考,3.5版本找得到数据源5.3找不到,唯一区别是3.5的32和64位我都安装了,我不确定电脑获取数据源识别的是哪个,因为两个安装路径是不一样的;

     所以我又下载安装了5.3版本32位的,安装后配置数据源总算有了odbc,但是会有两个(如上截图中一个ANSI,一个Unicode的),使用时选择Unicode版驱动比较好

 

2.都配置好后,点击run的时候,提示失败,报错You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version。。。

  解决:网上很多说法是关键字引用错误,百度了下mysql关键字,我数据库表的很多字段确实跟关键字冲突了,所以我把数据库表字段前面都加了个test,再执行就ok了

 

为了防止再犯这样的错误,下面贴上mysql关键字:

ADD ALL ALTER
ANALYZE AND AS
ASC ASENSITIVE BEFORE
BETWEEN BIGINT BINARY
BLOB BOTH BY
CALL CASCADE CASE
CHANGE CHAR CHARACTER
CHECK COLLATE COLUMN
CONDITION CONNECTION CONSTRAINT
CONTINUE CONVERT CREATE
CROSS CURRENT_DATE CURRENT_TIME
CURRENT_TIMESTAMP CURRENT_USER CURSOR
DATABASE DATABASES DAY_HOUR
DAY_MICROSECOND DAY_MINUTE DAY_SECOND
DEC DECIMAL DECLARE
DEFAULT DELAYED DELETE
DESC DESCRIBE DETERMINISTIC
DISTINCT DISTINCTROW DIV
DOUBLE DROP DUAL
EACH ELSE ELSEIF
ENCLOSED ESCAPED EXISTS
EXIT EXPLAIN FALSE
FETCH FLOAT FLOAT4
FLOAT8 FOR FORCE
FOREIGN FROM FULLTEXT
GOTO GRANT GROUP
HAVING HIGH_PRIORITY HOUR_MICROSECOND
HOUR_MINUTE HOUR_SECOND IF
IGNORE IN INDEX
INFILE INNER INOUT
INSENSITIVE INSERT INT
INT1 INT2 INT3
INT4 INT8 INTEGER
INTERVAL INTO IS
ITERATE JOIN KEY
KEYS KILL LABEL
LEADING LEAVE LEFT
LIKE LIMIT LINEAR
LINES LOAD LOCALTIME
LOCALTIMESTAMP LOCK LONG
LONGBLOB LONGTEXT LOOP
LOW_PRIORITY MATCH MEDIUMBLOB
MEDIUMINT MEDIUMTEXT MIDDLEINT
MINUTE_MICROSECOND MINUTE_SECOND MOD
MODIFIES NATURAL NOT
NO_WRITE_TO_BINLOG NULL NUMERIC
ON OPTIMIZE OPTION
OPTIONALLY OR ORDER
OUT OUTER OUTFILE
PRECISION PRIMARY PROCEDURE
PURGE RAID0 RANGE
READ READS REAL
REFERENCES REGEXP RELEASE
RENAME REPEAT REPLACE
REQUIRE RESTRICT RETURN
REVOKE RIGHT RLIKE
SCHEMA SCHEMAS SECOND_MICROSECOND
SELECT SENSITIVE SEPARATOR
SET SHOW SMALLINT
SPATIAL SPECIFIC SQL
SQLEXCEPTION SQLSTATE SQLWARNING
SQL_BIG_RESULT SQL_CALC_FOUND_ROWS SQL_SMALL_RESULT
SSL STARTING STRAIGHT_JOIN
TABLE TERMINATED THEN
TINYBLOB TINYINT TINYTEXT
TO TRAILING TRIGGER
TRUE UNDO UNION
UNIQUE UNLOCK UNSIGNED
UPDATE USAGE USE
USING UTC_DATE UTC_TIME
UTC_TIMESTAMP VALUES VARBINARY
VARCHAR VARCHARACTER VARYING
WHEN WHERE WHILE
WITH WRITE X509
XOR YEAR_MONTH ZEROFILL

  

 

datafactory5.6向mysql5.7添加大量测试数据