Book Image

Mastering phpMyAdmin 2.11 for Effective MySQL Management

Book Image

Mastering phpMyAdmin 2.11 for Effective MySQL Management

Overview of this book

Table of Contents (25 chapters)
Mastering phpMyAdmin 2.11 for Effective MySQL Management
Credits
About the Author
About the Reviewers
Preface

Views


MySQL 5.0 introduced support for named, updatable views. A view is a derived table—consider it as a virtual table—whose definition is stored in the database. A SELECT statement done on one or more tables (or even on views) is stored as a view and can itself be queried. Views can be used to:

  • Limit the visibility of columns (do not show the salary)

  • Limit the visibility of rows (do not show data for specific world regions)

  • Hide a changed table structure (so that legacy applications can continue to work)

As a view has itself some permissions attached to it, it is easier to GRANT permissions on the view as a whole, rather than defining cumbersome column-specific privileges on the underlying tables.

To activate views support on a server after an upgrade from a pre-5.0 version, the administrator has to execute the mysql_fix_privileges_tables script, as described in the MySQL manual.

Note

Each user must have the appropriate SHOW_VIEW or CREATE_VIEW privilege to be able to see or manipulate views...