Subject | Re: [firebird-support] Re: help update website content from local database |
---|---|
Author | Milan Babuskov |
Post date | 2009-10-09T16:17Z |
abel06077 wrote:
import that into MySQL...
Assuming these settings:
Table name: DATA
Firebird database: mydb.fdb
Firebird username: sysdba
Firebird password: ******
Remote server: 212.200.212.200
MySQL database: mydb
MySQL username: myu
MySQL password: myp
Download FBExport from here:
http://www.firebirdfaq.org/fbexport.php
Create a batch file on your Windows box containing this:
fbexport -si -v MYDATA -D mydb.fdb -P ******* -F insert.sql
This command will export data from whole table into insert.sql file. Now
you need to import this into your MySQL database. This is where we need
more details:
- do you have direct access to MySQL via SSH, stunnel or something similar?
- if not, do you have SSH access to remote machine?
- if you don't have either of those, you probably have a web server on
the other side, so you might want to tranfer the file via HTTP (or HTTPS
if you wish to secure it) and write a script on the webserver to import
it. To push the file you can use a command line tools like wget which
supports HTTP POST.
http://gnuwin32.sourceforge.net/packages/wget.htm
Assuming you have SSH access, which is really not uncommon anymore, you
can copy the file with SCP:
scp insert.sql user@212.200.212.200:
And then execute mysql client remotely to import the script:
ssh user@212.200.212.200 mysql -u myu -p myp -D mydb < insert.sql
Since you are on Windows, you need to install ssh and scp either from
MinGW or use Putty replacements (probably easier for you) named Plink
(ssh) and PSCP (scp):
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
Of course, to automate this, you need to setup a pair of keys for SSH so
you don't get a password prompt each time.
If you want something complex, like merging data into existing data or
similar, you should really do export into CSV, XML or some similar
format and write a small program on the server side to do the import
exactly the way you want.
--
Milan Babuskov
==================================
The easiest way to import XML, CSV
and textual files into Firebird:
http://www.guacosoft.com/xmlwizard
==================================
> export data from firebird ... imported into Mysql.Ok, here's an example how to export the entire table named MYDATA and
import that into MySQL...
Assuming these settings:
Table name: DATA
Firebird database: mydb.fdb
Firebird username: sysdba
Firebird password: ******
Remote server: 212.200.212.200
MySQL database: mydb
MySQL username: myu
MySQL password: myp
Download FBExport from here:
http://www.firebirdfaq.org/fbexport.php
Create a batch file on your Windows box containing this:
fbexport -si -v MYDATA -D mydb.fdb -P ******* -F insert.sql
This command will export data from whole table into insert.sql file. Now
you need to import this into your MySQL database. This is where we need
more details:
- do you have direct access to MySQL via SSH, stunnel or something similar?
- if not, do you have SSH access to remote machine?
- if you don't have either of those, you probably have a web server on
the other side, so you might want to tranfer the file via HTTP (or HTTPS
if you wish to secure it) and write a script on the webserver to import
it. To push the file you can use a command line tools like wget which
supports HTTP POST.
http://gnuwin32.sourceforge.net/packages/wget.htm
Assuming you have SSH access, which is really not uncommon anymore, you
can copy the file with SCP:
scp insert.sql user@212.200.212.200:
And then execute mysql client remotely to import the script:
ssh user@212.200.212.200 mysql -u myu -p myp -D mydb < insert.sql
Since you are on Windows, you need to install ssh and scp either from
MinGW or use Putty replacements (probably easier for you) named Plink
(ssh) and PSCP (scp):
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
Of course, to automate this, you need to setup a pair of keys for SSH so
you don't get a password prompt each time.
If you want something complex, like merging data into existing data or
similar, you should really do export into CSV, XML or some similar
format and write a small program on the server side to do the import
exactly the way you want.
--
Milan Babuskov
==================================
The easiest way to import XML, CSV
and textual files into Firebird:
http://www.guacosoft.com/xmlwizard
==================================