Databases Reference
In-Depth Information
Tracking in phpMyAdmin
phpMyAdmin's tracking system allows the user to specify which table is going to be
tracked, so it can be called an
opt-in system
. By default, no table is tracked unless
a developer elects to do so; and when a developer activates tracking for a table,
changes start to be recorded even if performed by someone else. Only the changes
done via phpMyAdmin are recorded.
Furthermore, for a given table, we can indicate which statements we are interested
in tracking. The list of statements is divided into two groups: data definition and
data manipulation.
Suppose that a team is working on a project that involves making changes to the
structure of tables. With tracking activated and assuming that each developer logs
in to MySQL with his or her own account, we now have access to historic data,
including information about which developer dropped some critical column! Of
course, this tracking is not tamper-proof; after all, it's stored in a MySQL table so the
security of this tracking information depends on who has access to the tracking table.
Prerequisites
The phpMyAdmin configuration storage holds all metadata for the tracking
mechanism. If we have implemented this storage a while ago (for a previous
phpMyAdmin version, such as 3.1 or older), we can use
scripts/create_tables.
sql
from the current phpMyAdmin version to upgrade the configuration storage
with the missing tables (in our case, the
pma_tracking
table). The reason for this
is that the script creates this table in a prudent way by using the
CREATE TABLE IF
NOT EXISTS `pma_tracking`
statement, thus ensuring that it won't be created if the
table is already present.
In phpMyAdmin 3.3.3, the type of the
data_sql
column in
pma_tracking
was changed from
TEXT
to
LONGTEXT
in the
create_tables.sql
script. Therefore, it's important to make
this change manually in our own
pma_tracking
table, if we ran
this script prior to version 3.3.3.
Search WWH ::
Custom Search