Databases Reference
In-Depth Information
However, this requires using a command-line tool that is not always possible
depending on the hosting options. Besides, some parts of the database may
already exist on the slave; therefore, the synchronize feature comes in handy
because it's integrated into phpMyAdmin, and also because it takes care of the
comparison phase.
Over viewing the synchronization process
The important principle is that synchronization is done from a source database to a
target database. During this operation, the source database remains unchanged. It's
up to us to correctly identify which database is the source and which one is the target
(and will be possibly modified).
The whole process is subdivided into steps which can be stopped at any stage:
• Server and database choice
• Comparison
• Full or selective synchronization
We could elect to stop the process for one of the following reasons:
• We don't have the necessary credentials to connect to one of the servers
• We see discrepancies between two databases and are not ready to
synchronize because further research needs to be done
• We notice after the comparison phase that the target database is adequately
synchronized
Before performing synchronization, we will put the necessary elements in place.
Preparing for the synchronization exercise
As we will play with only the
author
and
book
tables, this exercise will assume that
there are no other tables in the
marc_book
database. We start by copying the
marc_
book
database to
marc_book_dev
(refer to
Chapter 9
for the exact method for doing
this).Then we open the
marc_book_dev
database and perform the following actions:
• Delete the
book
table
• Delete one row of the
author
table
• Change the type of the
name
column from
VARCHAR(30)
to
VARCHAR(29)
• Delete the
phone
column from the
author
table
Chapter 5
covers how to perform the previous actions.
Search WWH ::
Custom Search