- Mastering phpMyAdmin 3.4 for Effective MySQL Management
- Marc Delisle
- 1070字
- 2021-08-20 15:55:21
Installing phpMyAdmin configuration storage
In addition to basic MySQL databases maintenance, phpMyAdmin offers advanced features that we will discover in the following chapters. These features require the installation of the phpMyAdmin configuration storage.
Goal of the configuration storage
The configuration storage consists of a set of tables that are used behind the scene by phpMyAdmin. They hold metadata which contains information to support special features such as query bookmarks and data transformation. Moreover, for tables using a storage engine that does not support foreign keys, relations between tables are kept in this configuration storage. The metadata is generated and maintained by phpMyAdmin on the basis of our actions from the interface.
Location of the configuration storage
There are two possible places to store these tables:
As this storage does not exist by default and because the phpMyAdmin team wants to promote it, the interface displays the following notice message on the home page:

This message can be disabled with the following parameter (which, by default, is set to FALSE):
$cfg['PmaNoRelation_DisableWarning'] = TRUE;
Performing the installation
The previous error message is displayed even if only a part of the configuration storage is lacking. Of course, on a fresh installation, all parts are lacking—our database has not yet heard of phpMyAdmin and needs to be outfitted with this configuration storage. Following the here link in the previous screenshot brings up a panel explaining that the pmadb
, and the tables that are supposed to be a part of it, are either missing or undefined.
It's important to realize that the configuration storage will be functional only if the following two conditions are met:
- Proper definitions are present in
config.inc.php
- The corresponding tables (and maybe the database) are created
To create the necessary structure that matches our current version of phpMyAdmin, a command file called create_tables.sql
is available in the scripts
sub-directory of the phpMyAdmin installation directory. However, we should not blindly execute it before understanding the possible choices—single-user installation or multi-user installation.
Even if we are entitled to only one database by the system administrator, we can still use all the advanced features of phpMyAdmin. In this setup, we will use our existing database to store the metadata tables.
We need to modify a local copy of the scripts/create_tables.sql
file to populate our database with all the needed tables. They will have the prefix pma_
to make them easily recognizable. We need to remove the following lines:
CREATE DATABASE IF NOT EXISTS `phpmyadmin` DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; USE phpmyadmin;
This is done because we won't be using a phpmyadmin
database but our own. Next, we should open our own database in phpMyAdmin. We are now ready to execute the script. There are two ways of doing this:
- As we already have the script in our editor, we can just copy the lines and paste them in the query box of the SQL page. More details on this in Chapter 11.
- Another way is to use the import technique shown in Chapter 7. We select the
create_tables.sql
script that we just modified.
After the creation, the navigation panel shows us the special pma_
tables along with our normal tables.
It is now time to adjust all the configuration storage related parameters in config.inc.php
. This can be done easily with the setup script as seen in this chapter, or by pasting the appropriate lines from the config.sample.inc.php
file. The database is our own and the table names are the ones that have just been created:
$cfg['Servers'][$i]['pmadb'] = 'mydatabase'; $cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark'; $cfg['Servers'][$i]['relation'] = 'pma_relation'; $cfg['Servers'][$i]['table_info'] = 'pma_table_info'; $cfg['Servers'][$i]['table_coords'] = 'pma_table_coords'; $cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages'; $cfg['Servers'][$i]['column_info'] = 'pma_column_info'; $cfg['Servers'][$i]['history'] = 'pma_history'; $cfg['Servers'][$i]['tracking'] = 'pma_tracking'; $cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords'; $cfg['Servers'][$i]['userconfig'] = 'pma_userconfig';
The pmadb
and each table have a specific function as listed next:

Between each phpMyAdmin version, the infrastructure may be enhanced—the changes are explained in Documentation.html
. This is why phpMyAdmin has various checks to ascertain the structure of the tables. If we know we are using the latest structure, $cfg['Servers'][$i]['verbose_check']
can be set to FALSE
to avoid checks, thereby slightly increasing phpMyAdmin's speed.
In this setup, we will have a distinct database—pmadb
—to store the metadata tables. Our control user will have specific rights to this database. Each user will work with his/her login name and password which will be used to access his/her databases. However, whenever phpMyAdmin itself accesses pmadb
to obtain some metadata, it will use the control user's privileges.
We first ensure that the control user pma
has been created and that its definition in config.inc.php
is appropriate. We then copy scripts/create_tables.sql
to our local workstation and edit it. We replace the following lines:
-- GRANT SELECT, INSERT, DELETE, UPDATE ON `phpmyadmin`.* TO -- 'pma'@localhost;
with these, removing the comment characters (double-dash):
GRANT SELECT, INSERT, DELETE, UPDATE ON `phpmyadmin`.* TO 'pma'@localhost;
We then execute this script by importing it (refer to Chapter 7). The net effect is to create the phpmyadmin
database, assign proper rights to user pma
, and populate the database with all the necessary tables.
The last step is to adjust all the parameters in config.inc.php
that relate to relational features. Please refer to the Installing for a single user section, except for the database name in the pmadb
parameter, which will be as shown in the following code snippet:
$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
The installation is now complete. We will test the features in the coming sections and chapters. We can do a quick check by logging out of phpMyAdmin, then logging in and displaying the home page; the warning message should be gone.
- 高手是如何做產(chǎn)品設(shè)計(jì)的(全2冊)
- Reactive Programming with Swift
- 概率成形編碼調(diào)制技術(shù)理論及應(yīng)用
- Linux Device Drivers Development
- Go并發(fā)編程實(shí)戰(zhàn)
- Corona SDK Mobile Game Development:Beginner's Guide(Second Edition)
- Java Web開發(fā)就該這樣學(xué)
- Node.js 12實(shí)戰(zhàn)
- C指針原理揭秘:基于底層實(shí)現(xiàn)機(jī)制
- Java EE Web應(yīng)用開發(fā)基礎(chǔ)
- Web編程基礎(chǔ):HTML5、CSS3、JavaScript(第2版)
- 軟件測試技術(shù)
- 零基礎(chǔ)學(xué)Java第2版
- Python應(yīng)用與實(shí)戰(zhàn)
- Instant GLEW