Frage stellen

CristianCantoro's Profil - Aktivität

2020-06-17 18:09:13 +0200 verliehene Abzeichen  Guru (Quelle)
2020-06-17 18:09:13 +0200 verliehene Abzeichen  Sehr gute Antwort (Quelle)
2017-11-05 15:57:06 +0200 verliehene Abzeichen  Hat Ahnung (Quelle)
2017-11-05 15:57:06 +0200 verliehene Abzeichen  Gute Antwort (Quelle)
2015-07-06 05:12:33 +0200 verliehene Abzeichen  Tolle Antwort (Quelle)
2013-01-06 17:52:57 +0200 verliehene Abzeichen  Totenbeschwörer (Quelle)
2013-01-06 17:52:57 +0200 verliehene Abzeichen  Lehrer (Quelle)
2013-01-03 17:31:08 +0200 verliehene Abzeichen  Redakteur (Quelle)
2013-01-03 17:29:35 +0200 Beantwortete Frage Migrate an ODB database to SQL server?

(Update: better read the OP question)

Yes, you can do that in two steps:

  1. Exporting your existing DB to a MySQL DB
  2. Connecting databases

== Exporting the DB ==

In the menu Tools > SQL...

type:

SCRIPT '<your-path>/<your-db-name>.sql'

Mind the quotes. Also replace <your-path> and <your-db-name> with your path and filename respectively.

On Windows this can look like:

SCRIPT 'c:/my documents/mydb.sql'

On Linux:

SCRIPT '/home/myuser/mydb.sql'

Click on Execute.

You will find the SQL dump of the database in the file <your-path>/<your-db-name>.sql

Here's how the result of the command looks like on a test db I have created:

SET DATABASE COLLATION "Italian"
CREATE SCHEMA PUBLIC AUTHORIZATION DBA
CREATE CACHED TABLE "Contatti"("IDAccount" INTEGER NOT NULL PRIMARY KEY,"NomeAccount" VARCHAR(50),"Descrizione" VARCHAR(250))
CREATE USER SA PASSWORD ""
GRANT DBA TO SA
SET WRITE_DELAY 60
SET SCHEMA PUBLIC
INSERT INTO "Contatti" VALUES(0,'prova','prova')
INSERT INTO "Contatti" VALUES(1,'pippo','pippo')
INSERT INTO "Contatti" VALUES(2,'pluto','pluto')

Also, please read these words of wisdom:

The output of the SCRIPT command or statement in the Tools -> SQL ... is a set of commands to create a complete database, including a default user, the database itself, create the tables and fill the tables with data. If you want to import this into a different database engine you have to skip several parts:

SET DATABASE COLLATION "Latin1_General"
CREATE SCHEMA PUBLIC AUTHORIZATION DBA
:
CREATE USER SA PASSWORD ""
GRANT DBA TO SA
SET WRITE_DELAY 60
SET SCHEMA PUBLIC

This are specific commands for the (single user) HDBSQL database and will probably cause funny or hazardous things in other databases. Databases uses their own language flavour to create a database and specify the language and encoding. [...] In general don't execute the complete content of the generated sql file at once in phpmyadmin (or whatever you use to manage the other database), but split it into logical segments (first only the lines with CREATE, ... and finally the lines with INSERT) and better try a single insert statement first before you run them all for the same table.

Source: OpenOffice Forum

== Connecting DB ==

When you create a new DB the wizard will show you the possibility to connect your Base file to an existing database (using various protocols). The wizard is quite self-explanatory, so you're done. I also think that if you know in advance that you'll be ... (more)