Table of Contents for
Mastering phpMyAdmin 3.4 for Effective MySQL Management

Version ebook / Retour

Cover image for bash Cookbook, 2nd Edition Mastering phpMyAdmin 3.4 for Effective MySQL Management by Marc Delisle Published by Packt Publishing, 2012
  1. Cover
  2. Mastering phpMyAdmin 3.4 for Effective MySQL Management
  3. Mastering phpMyAdmin 3.4 for Effective MySQL Management
  4. Credits
  5. About the Author
  6. About the Reviewers
  7. www.PacktPub.com
  8. Preface
  9. What you need for this book
  10. Who this book is for
  11. Conventions
  12. Reader feedback
  13. Customer support
  14. 1. Getting Started with phpMyAdmin
  15. What is phpMyAdmin?
  16. Installing phpMyAdmin
  17. Configuring phpMyAdmin
  18. Installing phpMyAdmin configuration storage
  19. Upgrading phpMyAdmin
  20. Summary
  21. 2. Configuring Authentication and Security
  22. Securing phpMyAdmin
  23. Summary
  24. 3. Over Viewing the Interface
  25. Customizing general settings
  26. Character sets and collations
  27. Navigation panel
  28. Main panel
  29. User preferences
  30. Query window
  31. Summary
  32. 4. Creating and Browsing Tables
  33. Creating our first table
  34. Inserting data manually
  35. Browse mode
  36. Profiling queries
  37. Creating an additional table
  38. Summary
  39. 5. Changing Data and Structure
  40. Changing table structure
  41. Summary
  42. 6. Exporting Structure and Data (Backup)
  43. Exporting a database
  44. Exporting a table
  45. Exporting selectively
  46. Exporting multiple databases
  47. Saving the export file on the server
  48. Memory limits
  49. Summary
  50. 7. Importing Structure and Data
  51. Importing SQL files
  52. Importing CSV files
  53. Importing other formats
  54. Reading files from a web server upload directory
  55. Displaying an upload progress bar
  56. Summary
  57. 8. Searching Data
  58. Performing a complete database search
  59. Stopping an errant query
  60. Summary
  61. 9. Performing Table and Database Operations
  62. Changing table attributes
  63. Emptying or deleting a table
  64. Renaming, moving, and copying tables
  65. Performing other table operations
  66. Multi-table operations
  67. Database operations
  68. Summary
  69. 10. Benefiting from the Relational System
  70. Defining relations with the relation view
  71. Defining relations with the Designer
  72. Benefiting from the defined relations
  73. Column commenting
  74. Summary
  75. 11. Entering SQL Statements
  76. The Query window
  77. Multi-statement queries
  78. Pretty printing (syntax highlighting)
  79. The SQL Validator
  80. Summary
  81. 12. Generating Multi-table Queries
  82. Exploring column criteria
  83. Generating automatic joins (internal relations)
  84. Executing the query
  85. The visual builder
  86. Summary
  87. 13. Synchronizing Data and Supporting Replication
  88. Supporting MySQL replication
  89. Summary
  90. 14. Using Query Bookmarks
  91. Creating bookmarks
  92. Recalling bookmarks from the bookmarks list
  93. Passing a parameter to a bookmark
  94. Summary
  95. 15. Documenting the System
  96. Generating relational schemas
  97. Summary
  98. 16. Transforming Data using MIME
  99. Enabling transformations
  100. Examples of transformations
  101. Summary
  102. 17. Supporting Features Added in MySQL 5
  103. Supporting routines—stored procedures and functions
  104. Executing code with triggers
  105. Using information_schema
  106. Partitioning
  107. Exploring the event scheduler
  108. Summary
  109. 18. Tracking Changes
  110. Prerequisites
  111. Principles
  112. Initiating tracking for one table
  113. Testing the tracking mechanism
  114. Determining tracking status
  115. Structure snapshot
  116. Exporting a version
  117. Creating a new version
  118. Deleting tracking information
  119. Summary
  120. 19. Administrating the MySQL Server
  121. Database information
  122. Server information
  123. Summary
  124. A. Troubleshooting and Support
  125. Seeking support
  126. Contributing to the project

Changing table attributes

Table attributes are the various properties of a table. This section discusses the settings for some of them.

Table storage engine

The first attribute we can change is called Storage Engine.

Table storage engine

This controls the whole behavior of the table—its location (on disk or in memory), the index structure, and whether it supports transactions and foreign keys. The drop-down list varies depending on the storage engines supported by our MySQL server.

Note

Changing a table's storage engine may be a long operation if the number of rows is large.

Table comments

Table comments option allows us to enter comments for the table.

Table comments

These comments will be shown at appropriate places, for example, in the navigation panel, next to the table name in the Table view, and in the export file. The following screenshot shows what the navigation panel looks like when the $cfg['ShowTooltip'] parameter is set to its default value of TRUE:

Table comments

The default value (FALSE) of $cfg['ShowTooltipAliasDB'] and $cfg['ShowTooltipAliasTB'] produces the behavior we saw earlier—the true database and table names are displayed in the navigation panel and in the Database view for the Structure page. Comments appear as a tooltip (when the cursor is hovered over a database or table name). If one of these parameters is set to TRUE, the behavior is reversed—showing the comment by default and the true name as a tooltip. This is convenient when the real table names are not meaningful.

There is another possibility for $cfg['ShowTooltipAliasTB']— the 'nested' value. Here is what happens if we use this feature:

  • The true table name is displayed in the navigation panel
  • The table comment (for example, project__) is interpreted as the project name and is displayed as it is (refer to the Nested display of tables within a database section in Chapter 3)

Table order

When we browse a table, or execute a statement such as SELECT * from book without specifying a sort order, MySQL uses the order in which the rows are physically stored. This table order can be changed with the Alter table order by dialog. We can choose any column and the table will be reordered once on this column. We choose author_id in the example, and after we click on Go, the table gets sorted on this column.

Reordering is convenient if we know that we will be retrieving rows in this order most of the time. Moreover, if we use an ORDER BY clause later on, and the table is already physically sorted on this column, we might get better performance.

This default ordering will last as long as there are no changes in the table (no insertions, deletions, or updates). This is why phpMyAdmin shows the (singly) warning.

Table order

After the sort has been done on author_id, books for author 1 will be displayed first, followed by the books for author 2, and so on (we are talking about a default browsing of the table without explicit sorting). We can also specify the sort order as Ascending or Descending.

If we insert another row, describing a new book from author 1, and then click on Browse, the book will not be displayed along with the other books for this author because the sort was done before the insertion.

Table collation

Character-based columns have a collation attribute that describes which character set is used to interpret the contents, and rules for sorting. The name column currently has a latin1_swedish_ci collation, as can be seen via the Structure page. On the Operations page, if we change the collation for table author from latin1_swedish_ci to, say, utf8_general_ci, this generates the following statement:

ALTER TABLE `author` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci

Therefore, we only changed the default collation for future columns that will be added to this table; no collation was changed for existing columns.

Table options

Other attributes that influence the table's behavior may be specified using the Table options dialog:

Table options

The options are:

  • PACK_KEYS: Setting this attribute results in a smaller index. This can be read faster but takes more time to update. Available for the MyISAM storage engine.
  • CHECKSUM: This makes MySQL compute a checksum for each row. This results in slower updates, but finding of corrupted tables becomes easier. Available for MyISAM only.
  • DELAY_KEY_WRITE: This instructs MySQL not to write the index updates immediately, but to queue them for writing later. This improves performance but there is a negative trade-off—the index might need to be rebuilt in case of a server failure (refer to http://dev.mysql.com/doc/refman/5.1/en/miscellaneous-optimization-tips.html). Available for MyISAM only.
  • TRANSACTIONAL, PAGE_CHECKSUM: Applies to the Aria storage engine, previously known as Maria. The TRANSACTIONAL option marks this table as being transactional; however, the exact meaning of this option varies as future versions of this storage engine will gain more transactional features. PAGE_CHECKSUM computes a checksum on all index pages. Currently documented at http://kb.askmonty.org/en/aria-storage-engine.
  • ROW_FORMAT: To the storage engines that support this feature (MyISAM, InnoDB, PBXT, and Aria), a choice of row format is presented. The default value being the current state of this table's row format.
  • AUTO_INCREMENT: This changes the auto-increment value. It is shown only if the table's primary key has the auto-increment attribute.