When you need to export data from firebird into mySQL the easiest way is to use fbexport program. It’s manual is located here:
http://fbexport.sourceforge.net/manual.html
$> FBExport.exe -D "c:\DB\WL.FDB" -U user –P password -Si -V TEST -F test.out
Where:
Si – means “export to SQL inserts” format
V – table name to export
F – output filename
Be careful with dates in mysql. Export in the correct format. To export db in custom date format use:
$> FBExport.exe -D "c:\DB\WL.FDB" -U user –P password -Si -V TEST -F test.out -J "Y-M-D" -K "H:M:S"
Where:
J - date format
K – time format
To import date to mySQL use SOURCE command:
$> mysql --user=root --password=password
$> use database_name
$> SOURCE c:\export\table_name.out
SOURCE command imports the whole file (executes SQL statements in it)
To narzędzie uratowało dzień :)
ReplyDeleteThanks, very useful !
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteyou used the windows to run these commands? because you use FBExport.exe and the site has only download option for linux.
ReplyDeleteWitam,
ReplyDeleteMam takie pytanie, w jaki sposób (z jakim parametrem) wyprowadzić selecta do pliku csv bez "".
Przykład:
jest tak: "1","2","3",...
a chciałbym tak: 1,2,3,...