Introduction

MySQL-to-DBF is a program to export MySQL databases into DBase (.dbf) format.

Features

  • All MySQL data types and attributes are supported
  • Works with all versions of Unix and Windows MySQL servers
  • Fast conversion engine (10MB MySQL database - in 1 minute on average P-III system)
  • Converts individual tables (see Select Tables article for related information)
  • Merges MySQL data into an existing DBF database
  • Command line support (see Command Line article for related information)
  • Easy-to-use wizard-style interface
  • Full install/uninstall support

Requirements

  • Windows 2000/XP or Windows NT 4 with Internet Explorer 5 or later, Windows 98/ME or Windows 95 with Internet Explorer 5 or later
  • At least 32 MB of available memory
  • Necessary privileges to read the source database on MySQL server

Limitations

  • Does not convert indexes


Command Line

To perform batch conversion or call the conversion procedure from an automation script you can use console version of MySQL-to-DBF S2DAGENT.EXE. Find this file in MySQL-to-DBF installation folder. You can either run this tool directly from command line or call it from any script as well. The program supports the following command-line options:

--blob2memo | map MySQL BLOB types into DBF MEMO
--dest=... | path to DBF database
--help | display help message and exit
--logfile=... | path to the logfile where execution traces will be written
--mode=... | how to process an existing DBF database (0 - overwrite the entire database, 1 - overwrite existing tables only, 2 - skip existing tables, 3 - merge)
--mysqlh=... | MySQL server IP address or network name
--mysqlu=... | MySQL user name
--mysqlp=... | MySQL user password
--port=... | MySQL port
--silent | use this option to disable program output
--src=... | MySQL database name
--tab_def | convert table definitions only
--tab_file=... | name of the file containing table names to convert (one table name per line)

In the following example the program converts MySQL database "db1" on the remote MySQL server "mysqlhost" to DBF database in folder "c:\db1\" using table names file "c:\tabfile1.txt":

S2DAGENT.EXE --src=db1 --dest=c:\db1\ --mysqlh=mysqlhost --mysqlu=administrator
--mysqlp=the_passsword --tab_file=c:\tabfile1.txt

Table names file should be formatted as follows:

Table_1
Table_2
...
Table_N

Notes:

  1. You can omit 'mysqlh' parameter to connect local MySQL server
  2. It is necessary to specify 'port' parameter only if it deffers from the default MySQL port 3306
  3. If you omit 'tab_file' parameter, all database tables will be converted
  4. If you omit 'mode' parameter, default mode 'overwrite the entire database' will be used
  5. Command line parameters that contain spaces should be enclosed in quotes (for example --dest="my database")


Connect to MySQL Server

On this wizard screen you should enter the necessary settings to establish connection with MySQL server. MySQL-to-DBF is able to connect to MySQL server using either local or remote mode. Local mode is being used to connect MySQL server launched on the same machine where you run MySQL-to-DBF from. Remote mode allows you to connect to MySQL server launched on another computer.

By default the program uses local connection mode. It is indicated by radio button "Local" selected. To establish remote connection you should select "Remote" radio button. For remote MySQL servers you should also enter host and TCP/IP port to connect through. Host could be either network name or IP address. TCP/IP port value is necessary only if it differs from the default MySQL port number 3306. Otherwise you may leave this field as is.

Finally, you are entering user name and password. You can leave these fields empty for anonymous connection.

NOTE: MySQL 4.1.0 uses the authentication protocol based on a password hashing algorithm that is incompatible with that used by MySQL-to-DBF. See Troubleshooting article to learn how to resolve this problem.


Merging and Overwriting

If you try to convert MySQL database into an existing DBF database, MySQL-to-DBF allows you to choose one of the following options: overwrite the database, merge into the database or specify another destination name.

  • Select 'Overwrite the entire database' option to replace the entire contents of the destination DBF database with MySQL data. Note that all data contained in DBF database will be lost.
  • Select 'Overwrite existing tables only' option to replace the contents of DBF tables having the same names as tables in source MySQL database.
  • Select 'Skip existing tables only' option to not convert existing tables.
  • Select 'Merge' option to merge MySQL data into the destination DBF database. MySQL-to-DBF implements quite simple merging algorithm: it appends the whole table contents to the corresponding DBF table. Note: the structures of source and destination tables must be identical.

If you decide to enter another destination name just click 'Cancel' button.


Select Databases

On the this wizard page you should enter source MySQL database name and path to destination DBF database. Also, you can customize the conversion process using the following settings:

  • Convert table definitions only - Select this check box to convert only table definitions of the original MySQL database.
  • Convert BLOB to Memo - Sometimes MySQL database authors define text columns as BLOB (for example, in order to perform case-sensitive comparison). In this case you should select the checkbox to obtain better conversion results.


Select Tables

On this wizard screen you can manage the list of MySQL tables to convert. In the left part of the screen you can see "Available tables" list box. It contains all available tables of the source database except those that you have selected already. On the right you can see "Selected tables" list box. To add new MySQL table for converting into DBF format you should select it in "Available tables" list box and click "Add" button (or double-click the selected item). Also you can use "Add all" button to insert all available MySQL tables. To remove an item from "Selected tables" list you should select it and click "Remove" button. You can use "Remove all" button to remove all items from "Selected tables" list box.


Troubleshooting

While working with MySQL-to-DBF wizard you may encounter unexpected behavior or result. Use the following information to solve some common problems and get the result you want. This summary is organized as a list of problem-resolution pairs. Each problem description starts with "P:" and each resolution - with "R:".

P: Error message "The program does not support authentication protocol requested by server..."
R: MySQL 4.1.0 uses the authentication protocol based on a password hashing algorithm that is incompatible with that used by MySQL-to-DBF. You can use OLD_PASSWORD function to make the certain account compatible with MySQL-to-DBF. Login to MySQL server with administrator privileges and run the following queries:

    mysql> USE mysql;
    mysql> UPDATE user SET Password = OLD_PASSWORD('mypass')
        -> WHERE Host = 'some_host' AND User = 'some_user';
    mysql> FLUSH PRIVILEGES;

Of course, you should place actual values instead of 'some_pass', 'some_host' and 'some_user'. Now you can use 'some_user' account with MySQL-to-DBF.

P: Error message "Can't connect to MySQL server on <host name or IP>".
R: Make sure MySQL server is launched on the target machine. Also please check the port number field to verify that you have specified the correct number.

P: There are no databases in 'MySQL database name' listbox.
R: The user has not enough privileges to extract databases list. Ask your MySQL server administrator give you 'SHOW DATABASES' privilege.

P: Error message "Access denied for user: <user-name>"
R: You will not be able to connect to MySQL server until you have the appropriate permissions. Ask your MySQL server administrator give you 'SELECT' privilege on the source MySQL database.

P: Program freezes on the second dialog while connecting to remote MySQL server.
R: MySQL server cannot resolve network names. Close the program, restart MySQL daemon with "--skip-name-resolve" option and try again.

If you came across some other kind of problem while using MySQL-to-DBF, please contact our support department at support@convert-in.com


Contents

Command Line

Connect to MySQL Server

Introduction

Merging and Overwriting

Select Databases

Select Tables

Troubleshooting