|

Q: How to transfer data from mysql to DBMaker?
A: There are several ways to transfer data from Mysql to DBMaker. The easiest way we sugguest is try to convert export file from Mysql to a DBMaker script file.
-
Use export tool 'mysqldump' in Mysql to export your data from mysql database to an output file. Note that when using 'mysqldump', do not give any special option. For example, if you want to export data from a Mysql database called 'test' to an output file 'test-out.txt', type this command.
$> mysqldump test > test-out.txt;
-
Type this command to change comment symbol '#' to '//' in test-out.txt and put the output to a file called 'dbmaker.txt'.
$> sed -e 's/#/\/\//g' test-out.txt > dbmaker.txt;
- Modify the output file for data type mapping and different syntax. See the following description about how to map data types from Mysql to DBMaker.
Data type mapping,
Some data types of mysql have no exact mapping types in DBMaker, here listed the sugguested, most similar types.
mysql data type |
DBMaker data type |
TINYINT |
SMALLINT |
SMALLINT |
SMALLINT |
MEDIUMINT |
INT,INTEGER |
INT |
INT |
INTEGER |
INTEGER |
BIGINT |
N/A |
FLOAT(4) |
FLOAT |
FLOAT(8) |
DOUBLE |
FLOAT |
FLOAT |
DOUBLE |
DOUBLE |
DOUBLE PRECISION |
DOUBLE |
REAL |
DOUBLE |
DECIMAL(p,s) |
DECIMAL(p,s) (*a) |
NUMERIC(p,s) |
DECIMAL(p,s) |
DATE |
DATE |
DATETIME |
TIMESTAMP |
TIMESTAMP |
TIMESTAMP |
TIME |
TIME |
YEAR |
SMALLINT |
CHAR(n) |
CHAR(n) |
VARCAHR(n) |
VARCAHR(n) |
TINYBLOB |
VARCHAR(255) |
TINYTEXT |
VARCHAR(255) |
BLOB |
LONG VARCHAR |
TEXT |
LONG VARCHAR |
MEDIUMBLOB |
LONG VARCHAR |
MEDIUMTEXT |
LONG VARCHAR |
LONGBLOB |
N/A (*b) |
LONGTEXT |
N/A (*b) |
ENUM |
N/A |
SET |
N/A |
PS.
-
For all numeric data types except decimal, need to remove display size argument when converting mysqldump output file to DBMaker.
-
The maximum length of 'LONG VARCAHR' and 'LONG VARBINARY' in DBMaker is 2^31-1. You can also map LONGBLOB,LONGTEXT columns to 'LONG VARCAHR' or 'LONG VARBINARY' if their lengths won't exceed this maximum.
-
For detailed description about data types of DBMaker, please refer to DBMaker manuals.
Different syntax,
-
Multiple Values in Value list
It is NOT a valid syntax in DBMaker or most other popular DBMS, you had better not use this option (extended insert) in mysqldump.
-
Special characters
In mysql, the special characters in insert value list like (') and (\) need to be specified using (\). In DBMaker, you must specify (') by repeating the same character, for example, If you want to enter a (') to table t1, type your command like this:
insert into t1 valuea ('''');
As for (\), it's treated as a normal character like 'a' in INSERT value list in DBMaker.
-
After all the different syntax in dbmaker.txt are changed. The output file dbmaker.txt can be accepted by dbmaker interactive tool 'dmsqlc' (cleint version) or 'dmsqls' (single user version). Type command 'run dbmake.txt' in it to execute the script file to insert data to a DBMaker database.
|