Prev | Current Page 117 | Next

Marc Delisle

"Mastering phpMyAdmin 2.11 for Effective MySQL Management"


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.
SQL compatibility mode: This lets us choose the flavor of SQL that we
export. We must know about the system on which we intend to import this
file. Among the choices are MySQL 3.23, MySQL 4.0, Oracle, and ANSI.
The options in Structure section are:
Add DROP TABLE / DROP VIEW: Adds a DROP TABLE IF EXISTS statement
before each CREATE TABLE statement, for example: DROP TABLE IF EXISTS
'author'. This way, we can ensure that the export file can be executed on
a database in which the same table already exists, updating its structure, but
destroying previous table contents. A DROP VIEW is used for views.
Add IF NOT EXISTS: Adds the IF NOT EXISTS modifier to CREATE TABLE
statements, avoiding an error during import if the table already exists.
Add AUTO_INCREMENT value: Puts auto-increment information on
the tables into the export, ensuring that the inserted rows in the tables will
receive the correct next auto-increment ID value.
Enclose table and field names with backquotes: Backquotes are the normal
way of protecting table and field names that may contain special characters.


Pages:
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129