How to use "center columns" in phpmyadmin?

The PMA has tools for adding center columns. As far as I understand, it was used with foreign restrictions. I have two tables: TableA and TableB .

TableA structure: id_of_A , name_of_A_value , ...

TableB structure: id_of_B , foreign_id_of_A , ... and an external constraint from foreign_id_of_A to A-table . id_of_A .

And it’s very difficult to select the necessary foreign_id_of_A , inserting a new row into TableB , because only the id_of_A value is id_of_A . Can central columns help me with this problem? How does the center speaker work?

+6
source share
3 answers

Center speaker

You can add / remove columns in the list according to your requirement. These columns in the central list will be available for use when creating a new table column or creating the table itself. You can select a column from the central list when creating a new column, this will save you from re-writing the same column definition or writing different names for a similar column.

To enable the use of this function:

  • configure $cfg['Servers'][$i]['pmadb'] and phpMyAdmin storage configuration

  • put the table name in $cfg['Servers'][$i]['central_columns'] (eg pma__central_columns)

This feature can be disabled by setting the configuration to false.

+4
source

I found an exhaustive description here:

As the name implies, the "Central Columns" function allows you to maintain a central list of columns for the database in order to avoid a similar name for the same data item and to ensure data type consistency for the same data item. You can use the central list of columns to add an element to any table structure in this database, which will be preserved when writing the same column name and column definition.

To add a column to the central list, go to the table structure page, check the columns you want to include, and then simply click Add to Center Columns. If you want to add all the unique columns from more than one table from the database, go to the database structure page, check the tables you want to include, and then select "Add columns to the central list."

To remove a column from the central list, go to the "Table Structure" page, check the columns you want to delete, and then simply click "Delete from Central Columns". If you want to remove all columns from several tables from the database, go to the database structure page, check the tables you want to include, and then select "Remove columns from the central list."

To view and manage the center list, select the database in which you want to manage the center columns, and then click "Center Columns" in the top menu. You will be taken to a page where you will have options for editing, deleting or adding new columns to the central list.

http://lees.geo.msu.edu/phpmyadmin/doc/html/faq.html

It may be useful for modeling external constraints, but it is absolutely useless to use. I'm still looking for a solution to add a value to one table by identifier from another table, so that it is clear to people, not computers. If you know how to do this, let me know.

+3
source

Perhaps the function you are looking for is a “Display Column” in the “Relation View” section of the table structure view. This allows you to choose which column is displayed in the PHPMyAdmin interface, regardless of what is stored in the database foreign key constraint.

If the line does not appear, you need to enable the function in PHPMyAdmin. See Frequently Asked Questions and related configuration parameter entries: $cfg["servers"][$i]["relation"] and $cfg["servers"][$i]["table_info"] (in the previous link during publications (I do not have enough reputation to post more than two links)).

Essentially, you create a pair of tables in a database that PHPMyAdmin can use to store additional data, and then tell it which tables. When this is done, PHPMyAdmin will allow you to choose which columns will be displayed (when you hover over the associated column and when editing data). If you installed it on your Linux distribution through the package manager, it should have already created these tables for you (or at least asked if you would like to), if this is not the case, you may need to reinstall the package. I have no experience installing it on Windows or Mac OS X, but I would suggest that there is some automated way to create these tables for these platforms.

(In Debian and Debian-based distributions (such as Ubuntu), the additional database is configured using db-config-common . If it was not configured during installation, dpkg-reconfigure phpmyadmin will allow you to configure the database (please note that this may result in the loss of some user / system settings in PHPMyAdmin).

+2
source

Source: https://habr.com/ru/post/989870/


All Articles