如何在 phpmyadmin 中使用 "central columns"?
How to use "central columns" in phpmyadmin?
PMA 有添加中央列的工具。据我了解,它是在有外国约束的情况下使用的。我有两个表:TableA
和 TableB
.
TableA
的结构:id_of_A
、name_of_A_value
、...
TableB
的结构:id_of_B
、foreign_id_of_A
、...
和从 foreign_id_of_A
到 A-table
的外部约束。id_of_A
.
并且在将新行插入 TableB
时很难 select 需要 foreign_id_of_A
,因为只有 id_of_A
的值可见。中央列可以帮助我解决这个问题吗?中心柱如何工作?
我发现这里有详尽的描述:
As the name suggests, the Central columns feature enables to maintain a central list of columns per database to avoid similar name for the same data element and bring consistency of data type for the same data element. You can use the central list of columns to add an element to any table structure in that database which will save from writing similar column name and column definition.
To add a column to central list, go to table structure page, check the columns you want to include and then simply click on “Add to central columns”. If you want to add all unique columns from more than one table from a database then go to database structure page, check the tables you want to include and then select “Add columns to central list”.
To remove a column from central list, go to Table structure page, check the columns you want to remove and then simply click on “Remove from central columns”. If you want to remove all columns from more than one tables from a database then go to database structure page, check the tables you want to include and then select “Remove columns from central list”.
To view and manage the central list, select the database you want to manage central columns for then from the top menu click on “Central columns”. You will be taken to a page where you will have options to edit, delete or add new columns to central list.
http://lees.geo.msu.edu/phpmyadmin/doc/html/faq.html
可能对国外的约束建模有用,但用起来绝对没用。我仍在寻找一种解决方案,通过另一个 table 的 ID 为一个 table 添加价值,以便人们可以理解它,而不是计算机。如果你知道怎么做,请告诉我。
也许您要查找的功能是 table 结构视图中 "Relation View" 下的 "Display Column"。这允许您选择在 PHPMyAdmin 界面中显示的列,而不管数据库外键约束中存储的是什么。
如果未显示该行,则需要在 PHPMyAdmin 中启用该功能。看到FAQ Entry and relevant configuration option entries: $cfg["servers"][$i]["relation"]
和$cfg["servers"][$i]["table_info"]
(在之前link,在posting的时候(我没有足够的声望post超过2 links)).
本质上,您在数据库中创建了几个 tables,PHPMyAdmin 可以使用它们来存储额外的数据,然后告诉它这些是哪些 tables。完成此操作后,PHPMyAdmin 会让您选择要显示的列(鼠标悬停在 linked 列上,同时编辑数据)。如果你通过包管理器将它安装在 Linux 发行版上,它应该已经为你创建了这些 table(或者至少询问你是否想要),如果没有,re-installing 包可能会有所帮助。我没有在 Windows 或 Mac OS X 上安装它的任何经验,但我认为有一些自动方法可以为那些创建这些 tables平台。
(在 Debian 和 Debian-based Linux 发行版上(例如 Ubuntu),额外的数据库配置为 db-config-common
。如果在安装时没有配置, dpkg-reconfigure phpmyadmin
将允许您设置数据库(请注意,这可能会破坏 PHPMyAdmin 中的某些 user/system 首选项)。)
中柱
您可以根据需要将 add/remove 列添加到列表中。当您为 table 创建新列或创建 table 本身时,中央列表中的这些列将可用。您可以 select 在创建新列时从中央列表中选择一列,这样可以避免重复编写相同的列定义或为类似的列编写不同的名称。
要允许使用此功能:
设置 $cfg['Servers'][$i]['pmadb']
和 phpMyAdmin 配置
存储
将 table 名称放入 $cfg['Servers'][$i]['central_columns']
(e.g. pma__central_columns)
可以通过将配置设置为 false 来禁用此功能。
PMA 有添加中央列的工具。据我了解,它是在有外国约束的情况下使用的。我有两个表:TableA
和 TableB
.
TableA
的结构:id_of_A
、name_of_A_value
、...
TableB
的结构:id_of_B
、foreign_id_of_A
、...
和从 foreign_id_of_A
到 A-table
的外部约束。id_of_A
.
并且在将新行插入 TableB
时很难 select 需要 foreign_id_of_A
,因为只有 id_of_A
的值可见。中央列可以帮助我解决这个问题吗?中心柱如何工作?
我发现这里有详尽的描述:
As the name suggests, the Central columns feature enables to maintain a central list of columns per database to avoid similar name for the same data element and bring consistency of data type for the same data element. You can use the central list of columns to add an element to any table structure in that database which will save from writing similar column name and column definition.
To add a column to central list, go to table structure page, check the columns you want to include and then simply click on “Add to central columns”. If you want to add all unique columns from more than one table from a database then go to database structure page, check the tables you want to include and then select “Add columns to central list”.
To remove a column from central list, go to Table structure page, check the columns you want to remove and then simply click on “Remove from central columns”. If you want to remove all columns from more than one tables from a database then go to database structure page, check the tables you want to include and then select “Remove columns from central list”.
To view and manage the central list, select the database you want to manage central columns for then from the top menu click on “Central columns”. You will be taken to a page where you will have options to edit, delete or add new columns to central list.
http://lees.geo.msu.edu/phpmyadmin/doc/html/faq.html
可能对国外的约束建模有用,但用起来绝对没用。我仍在寻找一种解决方案,通过另一个 table 的 ID 为一个 table 添加价值,以便人们可以理解它,而不是计算机。如果你知道怎么做,请告诉我。
也许您要查找的功能是 table 结构视图中 "Relation View" 下的 "Display Column"。这允许您选择在 PHPMyAdmin 界面中显示的列,而不管数据库外键约束中存储的是什么。
如果未显示该行,则需要在 PHPMyAdmin 中启用该功能。看到FAQ Entry and relevant configuration option entries: $cfg["servers"][$i]["relation"]
和$cfg["servers"][$i]["table_info"]
(在之前link,在posting的时候(我没有足够的声望post超过2 links)).
本质上,您在数据库中创建了几个 tables,PHPMyAdmin 可以使用它们来存储额外的数据,然后告诉它这些是哪些 tables。完成此操作后,PHPMyAdmin 会让您选择要显示的列(鼠标悬停在 linked 列上,同时编辑数据)。如果你通过包管理器将它安装在 Linux 发行版上,它应该已经为你创建了这些 table(或者至少询问你是否想要),如果没有,re-installing 包可能会有所帮助。我没有在 Windows 或 Mac OS X 上安装它的任何经验,但我认为有一些自动方法可以为那些创建这些 tables平台。
(在 Debian 和 Debian-based Linux 发行版上(例如 Ubuntu),额外的数据库配置为 db-config-common
。如果在安装时没有配置, dpkg-reconfigure phpmyadmin
将允许您设置数据库(请注意,这可能会破坏 PHPMyAdmin 中的某些 user/system 首选项)。)
中柱
您可以根据需要将 add/remove 列添加到列表中。当您为 table 创建新列或创建 table 本身时,中央列表中的这些列将可用。您可以 select 在创建新列时从中央列表中选择一列,这样可以避免重复编写相同的列定义或为类似的列编写不同的名称。
要允许使用此功能:
设置
$cfg['Servers'][$i]['pmadb']
和 phpMyAdmin 配置 存储将 table 名称放入
$cfg['Servers'][$i]['central_columns']
(e.g. pma__central_columns)
可以通过将配置设置为 false 来禁用此功能。