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

User preferences

One instance of phpMyAdmin can be installed to serve multiple users; however, before version 3.4.0, these users had to be content with the parameter values as chosen by the person in charge for this instance.

It's true that some pages on the interface has allowed tweaking specific parameters and that some of these were remembered in cookies, for example, the chosen language; but this version is the first to offer a global mechanism for adjusting and remembering preferences per user.

Even in the case where the instance has only one user, it's more convenient to be able to fine-tune preferences from the interface rather than manipulating the configuration file.

Accessing user preferences

From the home page, we click on More settings. From any page in Server view, we click on the Settings menu tab. Upon entering the Settings panel, we see the Manage your settings sub-page:

Accessing user preferences

This sub-page is where we act globally on our preferences. Other sub-pages such as Features and Main frame are used to change specific preferences—refer to the Changing settings section.

The Import and Export dialogs will be covered in the Possible locations for saving preferences section. The More settings dialog reminds us that config.inc.php is the place to configure all possibilities, for example, specifying servers and authentication modes is out of scope for user preferences.

The Reset dialog enables us to go back to default values for all user preferences in one easy click.

Possible locations for saving preferences

There are three possible places where user preferences can be saved. Each one has pros and cons; this section covers these modes.

Saving in phpMyAdmin configuration storage

To enable this mode, $cfg['Servers'][$i]['userconfig'] must be configured with the name of the table which holds these preferences, and the table must exist. This saving location is most useful because settings are immediately applied to the running instance upon login; moreover, it follows the user on whichever browser he happens to use.

If this storage is not configured, the settings page greets us with the following message:

Your preferences will be saved for current session only. Storing them permanently requires phpMyAdmin configuration storage.

Saving in a file

We always have the possibility of exporting our settings to a file and importing them back. The file follows the JSON format (see http://json.org). This method can be handy in the following situations:

  • We plan to use these settings on another phpMyAdmin instance
  • We want to keep a history of our settings; therefore, saving them from time to time in several files

Saving in the browser's local storage

Recent browsers, for example Firefox 6 and Internet Explorer 9, offer a local storage mechanism which is persistent between sessions. The first time we enter the Manage your settings sub-page, we see the You have no saved settings! message inside the Import from browser's storage dialog. However, after exporting settings to browser's local storage, the Import section tells us the date and time when settings were last saved using this mechanism.

In addition, when phpMyAdmin settings are found in the browser's storage and the phpMyAdmin configuration storage is not available, each phpMyAdmin page has the following message at the top:

Your browser has phpMyAdmin configuration for this domain. Would you like to import it for current session? Yes / No

A drawback of using this method is that our settings are only available when we are using this browser; moreover, if our browser's settings do not follow us when we change workstations, the settings are tied to this specific workstation (and apply to any other user running phpMyAdmin on it).

Changing settings

Upon entering a sub-page for specific preferences—in this case, the Main frame sub-page, we see a third level of menus related to this subject:

Changing settings

If a preference has been changed from its default value, the checkbox or data field has a different background color and a recycle icon is shown next to it, to quickly reset this preference to its default value. Quick explanations are given for each directive and links point to the documentation and the official wiki. As a general advice, we need to save any change we make on a page before changing to a different sub-page; however, in this example, we can switch from Startup to other third-level menus such as Browse mode and back without losing our changes.

Disallowing specific preferences

The person in charge of config.inc.php has the last word about which settings are changeable in the user preferences. To disallow some settings, we use the $cfg['UserprefsDisallow'] directive. We place into it an array containing the keys in $cfg that represent the directives to disallow. As an example, we set this directive to:

$cfg['UserprefsDisallow'] = array('AjaxEnable', 'MaxDbList');

This produces a warning as shown in the following screenshot:

Disallowing specific preferences

Showing developer settings

Some settings are sensitive and are intended only for the persons developing phpMyAdmin. For example, the possibility of displaying all errors, including PHP notices, can lead to disclose the full path of the phpMyAdmin instance. Therefore, in the Features sub-tab, the Developer menu is shown only if $cfg['UserprefsDeveloperTab'] is set to true.