简体   繁体   English

phpmyadmin - 默认为结构而不是浏览

[英]phpmyadmin - default to structure instead of browse

Can I set the default in phpMyAdmin to open in structure instead of browse?我可以将 phpMyAdmin 中的默认设置设置为在结构中打开而不是浏览吗?

thanks谢谢

If perchance you are using the "quick access icon" next to the table name in the navigation frame, this may be configured.如果您正在使用导航框架中表格名称旁边的“快速访问图标”,则可以对其进行配置。

From the configuration file documentation:从配置文件文档:

$cfg['LeftDefaultTabTable'] string $cfg['LeftDefaultTabTable'] 字符串

Defines the tab displayed by default when clicking the small icon next to each table name in the navigation panel.定义单击导航面板中每个表名称旁边的小图标时默认显示的选项卡。 Possible values: "tbl_structure.php", "tbl_sql.php", "tbl_select.php", "tbl_change.php" or "sql.php".可能的值:“tbl_structure.php”、“tbl_sql.php”、“tbl_select.php”、“tbl_change.php”或“sql.php”。

For MAMP 3.x the DefaultTabTable configuration parameter applies.对于MAMP 3.x ,适用DefaultTabTable配置参数。 It needs to be set in MAMP/bin/phpMyAdmin/config.inc.php , eg:它需要在MAMP/bin/phpMyAdmin/config.inc.php ,例如:

$cfg['DefaultTabTable'] = 'sql.php';

As I said in my comment, you can click on the little table icon to the left of the table name (assuming, as Mike B said, we are talking about the table list on the left) and it will open up the table structure page.正如我在评论中所说,您可以单击表名称左侧的小表图标(假设,正如 Mike B 所说,我们正在谈论左侧的表列表),它将打开表结构页面.

AFAIK, switching the behavior on those links is not possible through a configuration directive. AFAIK,无法通过配置指令切换这些链接上的行为。 You would have to dig through the code and change it in there.您将不得不深入研究代码并在其中进行更改。 Shouldn't be too complicated, though.不过应该不会太复杂。

Add:添加:

$cfg['DefaultTabTable'] = 'tbl_structure.php';

To either config.inc.php or config.default.php .config.inc.phpconfig.default.php

You can also change LeftDefaultTabTable which changes the icon.您还可以更改LeftDefaultTabTable以更改图标。 The options are:选项是:

  • 'tbl_structure.php' = fields list 'tbl_structure.php' = 字段列表
  • 'tbl_sql.php' = SQL form 'tbl_sql.php' = SQL 形式
  • 'tbl_select.php' = search page 'tbl_select.php' = 搜索页面
  • 'tbl_change.php' = insert row page 'tbl_change.php' = 插入行页面
  • 'sql.php' = browse page 'sql.php' = 浏览页面

In phpMyAdmin 4.8.2...在 phpMyAdmin 4.8.2 中...

  1. Click the double gears icon at the top of the left navigation pane.单击左侧导航窗格顶部的双齿轮图标。
  2. Then click the "Tables" tab within the popup modal.然后单击弹出模式中的“表格”选项卡。 (last tab) (最后一个标签)
  3. There you can set the "Target for quick access icon" setting, which is referring to the little index card icon to the left of the table links in the left pane.在那里您可以设置“快速访问图标的目标”设置,它指的是左窗格中表格链接左侧的小索引卡图标。

在此处输入图片说明 在此处输入图片说明

I didn't see any settings to change the default link behavior, but you can also add an additional "Target for second quick access icon" and define it's default view behavior differently if desired.我没有看到任何更改默认链接行为的设置,但您还可以添加一个额外的“第二个快速访问图标的目标”,并根据需要以不同的方式定义它的默认视图行为。 It adds an additional "Quick access" icon to the left of the table links with your chosen behavior.它在与您选择的行为链接的表格左侧添加了一个额外的“快速访问”图标。

In version 3.5.1: go to the PhpMyAdmin home page -> Settings -> Navigation Frame -> Tables tab.在 3.5.1 版本中:转到 PhpMyAdmin 主页 -> 设置 -> 导航框架 -> 表格选项卡。 Here you will find an option "Target for quick access icon", and set it在这里你会找到一个选项“快速访问图标的目标”,并设置它

"sql.php" if you want it to go to the Browse tab "tbl_structure.php" if you want it to go to the Structure tab "tbl_sql.php" if you want it to go to the SQL tab "tbl_select.php" if you want it to go to the Search tab "tbl_change.php" if you want it to go to the Insert tab. “sql.php”如果你想它去浏览选项卡“tbl_structure.php”如果你想它去结构选项卡“tbl_sql.php”如果你想它去SQL选项卡“tbl_select.php”如果您希望它转到“搜索”选项卡“tbl_change.php” 如果您希望它转到“插入”选项卡。

Then Save.然后保存。

This way when you will click on the table name, it will go to the structure;这样当你点击表名时,它会转到结构; and when clicking on the little icon before the table name, it will go to the tab you just set.当单击表名称前的小图标时,它会转到您刚刚设置的选项卡。

I use an old version of XAMPP (1.6.7) which contains an old version of phpMyAdmin (2.11.7), but the following worked for me.我使用旧版本的 XAMPP (1.6.7),其中包含旧版本的 phpMyAdmin (2.11.7),但以下对我有用。

In the /phpmyadmin/libraries/config.default.php file there is a section of code that handles how the table is viewed.在 /phpmyadmin/libraries/config.default.php 文件中有一段代码用于处理如何查看表。

Change the last two lines of code to suit your purposes, for mine I wanted to open tables in "Browse" view, not "Structure" view (which was my default).更改最后两行代码以适合您的目的,我想在“浏览”视图中打开表格,而不是“结构”视图(这是我的默认设置)。

   /**
     * Possible values:
     * 'tbl_structure.php' = fields list
     * 'tbl_sql.php' = SQL form
     * 'tbl_select.php' = select page
     * 'tbl_change.php' = insert row page
     * 'sql.php' = browse page
     *
     * @global string $cfg['DefaultTabTable']
     */

    // Show table Structure - Default
    $cfg['DefaultTabTable'] = 'tbl_structure.php';

    // Uncomment below to show table data
    // $cfg['DefaultTabTable'] = 'sql.php';

Save this config file and refresh PhpMyAdmin in your browser.保存此配置文件并在浏览器中刷新 PhpMyAdmin。

Hope that helps!希望有帮助!

In my version, the configuration setting for it is supposed to be在我的版本中,它的配置设置应该是

  $cfg['DefaultTabTable'] = 'tbl_structure.php';

It is listed in sample config file.它列在示例配置文件中。 However, /libraries/navigation/Nodes/Node_Table.class.php on line 34 ignores this setting and uses 'sql.php' directly.但是,第 34 行的 /libraries/navigation/Nodes/Node_Table.class.php 会忽略此设置并直接使用 'sql.php'。 I changed that line to我把那行改成

'text' => $GLOBALS['cfg']['DefaultTabTable'].'?server=' . $GLOBALS['server']

On that line and it works fine for me.在那条线上,它对我来说很好用。

navigation.php Around Line #646 in phpMyAdmin version 3.3.8 Insert navigation.php 在 phpMyAdmin 版本 3.3.8 中的第 646 行周围插入

$href = $GLOBALS['cfg']['LeftDefaultTabTable'] . '?'
            . $GLOBALS['common_url_query']
            .'&table=' . urlencode($table['Name'])
            .'&goto=' . $GLOBALS['cfg']['LeftDefaultTabTable'];

AFTER

$href = $GLOBALS['cfg']['DefaultTabTable'] . '?'
            .$GLOBALS['common_url_query'] . '&table='
            .urlencode($table['Name']) . '&pos=0';

to make the text field name link in the navigation to behave the same as the little icon to the left of it.使导航中的文本字段名称链接的行为与其左侧的小图标相同。

Go to phpMyAdmin/config.inc.php转到phpMyAdmin/config.inc.php

find line starting找到行开始

$cfg['DefaultTabTable'] $cfg['DefaultTabTable']

and set it to value并将其设置为值

$cfg['DefaultTabTable'] = 'browse';

Restart Apache, empty session data (second icon under phpMyAdmin logo, alternatively log-out and log-in, not sure if this step is needed, some configs are cached in user's session)重启Apache,清空会话数据(phpMyAdmin logo下的第二个图标,或者注销和登录,不确定是否需要这一步,一些配置缓存在用户会话中)

This solved the issue in MAMP 5.7 (ie if you click on table name in left navigation tree, the Browse tab is open).这解决了 MAMP 5.7 中的问题(即,如果您单击左侧导航树中的表名,则浏览选项卡将打开)。 PhpMyAdmin is located in MAMP/bin folder PhpMyAdmin 位于 MAMP/bin 文件夹中

Depending on the phpMyAdmin version either of these should work:根据 phpMyAdmin 版本,这些应该可以工作:

$cfg['LeftDefaultTabTable'] = 'tbl_structure.php';

$cfg['NavigationTreeDefaultTabTable'] = 'tbl_structure.php';

Also you may actually be saving these setting in the phpmyadmin database, table=pma__userconfig.此外,您实际上可能将这些设置保存在 phpmyadmin 数据库中,table=pma__userconfig。 Go ot the phpmyadmin home and click Settings -> Navigation Frame ->Tables -> Target for quick access icon转到 phpmyadmin 主页并单击设置 -> 导航框架 -> 表格 -> 快速访问图标的目标

I was following the instructions from etheros and wasn't able to find that configuration option, but it can just be added (to the confic.inc.php file).我按照 etheros 的说明进行操作,但找不到该配置选项,但可以将其添加(添加到 confic.inc.php 文件中)。 In my config file, I added it to the "Left frame setup" section, around line 160.在我的配置文件中,我将它添加到“左框架设置”部分,大约第 160 行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM