dbf2mysql, mysql2dbf - convert between xBase and MySQL databases
] [-o field
]] [-d database
]] [-p primary
] [-U user
database -t table
] [-P password
] [-U user
takes an xBase file and sends queries to an MySQL server to
insert it into an MySQL table.
dumps a MySQL table to a dbf file.
- Produce some status output.
- More verbose.
- Even more verbose: produce a progress report.
- Translate all field names in the xBase file to
- Translate all text in the xBase file to uppercase.
- Translate all text in the xBase file to lowercase.
- Allow NULL fields: 'NOT NULL' will be not added in table
- -o field[,field[,...]]
- List fields to insert into MySQL database. Primary use is
to ease import of complex dbf files where we want only few fields. NOTE:
-o is processed before substitution (-s), so you have to use
dbf field names here.
- -e conversion-file
- Specify file for CHAR fields conversion. File format is:
1st line: number of characters to convert (number of lines). Further
lines: <char_to_convert> <char_after_conversion>.
- Takes a list of field name/new field name pairs. Primary
use is to avoid conflicts between field names and MySQL reserved keywords.
When the new field name is empty, the field is skipped in both the CREATE
clause and the INSERT clauses, i.e. it will not be present in the MySQL
table. For example:
- -i field[,field[,...]]
- List fields to be indexed. MySQL field names should be used
- -d database
- Select the database to insert into. Default is 'test'.
- -t table
- Select the table to insert into. Default is 'test'.
- Create table if one doesn't exist already. If the table
already exists, drop it and build a new one. The default is to insert all
data into the named table. If -cc is specified, no records will be
- -p primary
- Select the primary key. You have to give the exact field
- -h host
- Select the host to insert into. Untested.
- Fixed length records. (By default CHAR is saved as
- dbf2mysql: "Quick" mode. Inserts data via
temporary file using 'LOAD DATA INFILE' MySQL statement. This increased
insertion speed on my PC 2-2.5 times. Also note that during whole 'LOAD
DATA' affected table is locked.
- mysql2dbf: Specify custom query to use.
- Trim trailing and leading whitespace from CHAR type fields
- Start each table with _rec and _timestamp fields.
- -P password
- Specify password on the MySQL server.
- -U user
- Specify user on the MySQL server.
can't write MEMO files at this time.
Possibly incorrect field lengths for REAL numbers.
Originally written by Maarten Boekhold <email@example.com>, Oct
Patched for MySQL by Michael Widenius <firstname.lastname@example.org>, 3 Nov 1996.
Manual page written for Debian GNU/Linux from README by Heiko Schlittermann
<email@example.com>, Aug 1997; updated by Matej Vela
<firstname.lastname@example.org>, Nov 2001.
Use this piece of software as you want, modify it to suit your needs, but please
leave my name in place ok? :)
The authors do not accept any responsibility for possible damage you get as
result of using this program.