Databases Reference
In-Depth Information
•
Disable
foreign
key
checks
: In the export file, we can add
DROP
TABLE
statements. However, normally a table cannot be dropped if it is referenced
in a foreign key constraint. This option overrides the verification by adding
SET
FOREIGN_KEY_CHECKS=0
to the export file. This override only lasts for the
duration of the import.
•
Database
system
or
older
MySQL
server
to
maximize
output
compatibility
with
: This lets us choose the flavor of SQL that we export. We must know
about the system onto which we intend to import this file. Among the choices
are
MySQL
3.23
,
MySQL
4.0
,
ORACLE
, and
ANSI
.
We may want to export the structure, the data, or both; this is performed with the
Dump
table
option. Selecting
Structure
generates the section with
CREATE
queries,
and selecting
Data
produces
INSERT
queries.
If we select
Structure
, the
Object
creation
options
sub-panel appears, as depicted in
the following screenshot:
The structure options are:
•
Add
DROP
TABLE
/
VIEW
/
PROCEDURE
/
FUNCTION
/
EVENT
: Adds
a
DROP
...
IF
EXISTS
statement before each
CREATE
statement, for example,
DROP
TABLE
IF
EXISTS
`author`;
. This way, we can ensure that the export
file is executed on a database in which the same element already exists,
updating its structure but destroying the previous element's contents.
•
Add
CREATE
PROCEDURE
/
FUNCTION
/
EVENT
: This includes all
procedures, functions, and event definitions found in this database, in
the export.
Search WWH ::
Custom Search