gpt4 book ai didi

mysql - dbf2mysql不插入记录

转载 作者:行者123 更新时间:2023-11-29 23:31:31 24 4
gpt4 key购买 nike

我正在使用 dbf2mysql 库 http://manpages.ubuntu.com/manpages/natty/man1/dbf2mysql.1.html将一些数据移植到mysql,但是当我尝试查看插入的记录时,没有插入任何内容。

这是我正在运行的命令:

$ dbf2mysql -vvv -q -h localhost -P password -U root smb/C_clist.DBF -d opera_dbf -t pricelists -c
Opening dbf-file smb/C_clist.DBF
dbf-file: smb/C_clist.DBF - Visual FoxPro w. DBC, MySQL-dbase: opera_dbf, MySQL-table: pricelists
Number of records: 12
Name Length Display Type
-------------------------------------
CL_CODE 8 0 C
CL_DESC 30 0 C
CL_CURR 3 0 C
CL_FCDEC 1 0 N
Making connection to MySQL-server
Dropping original table (if one exists)
Building CREATE-clause
Sending create-clause
CREATE TABLE pricelists (CL_CODE varchar(8) not null,
CL_DESC varchar(30) not null,
CL_CURR varchar(3) not null,
CL_FCDEC int not null)

fields in dbh 4, allocated mem for query 279, query size 139
Inserting records
Inserting record 0
LOAD DATA LOCAL INFILE '/tmp/d2mygo04TM' REPLACE INTO table pricelists fields terminated by ',' enclosed by ''''
Closing up....

然后在 mysql 中,使用正确的字段类型创建表,但没有数据:

mysql> use opera_dbf;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> describe pricelists;
+----------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+-------------+------+-----+---------+-------+
| CL_CODE | varchar(8) | NO | | NULL | |
| CL_DESC | varchar(30) | NO | | NULL | |
| CL_CURR | varchar(3) | NO | | NULL | |
| CL_FCDEC | int(11) | NO | | NULL | |
+----------+-------------+------+-----+---------+-------+
4 rows in set (0.13 sec)

mysql> select * from pricelists;
Empty set (0.00 sec)

mysql>

我错过了什么?

最佳答案

我删除了 -q 选项并且它有效

-q dbf2mysql:“快速”模式。使用临时文件插入数据 ‘LOAD DATA INFILE’MySQL 语句。这增加了插入 速度是我的 PC 上的 2-2.5 倍。另请注意,在整个 'LOAD DATA 受影响的表已被锁定。

关于mysql - dbf2mysql不插入记录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26547900/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com