phpmyadmin - default to structure instead of brows

2019-06-14 23:43发布

问题:

Can I set the default in phpMyAdmin to open in structure instead of browse?

thanks

回答1:

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.

AFAIK, switching the behavior on those links is not possible through a configuration directive. You would have to dig through the code and change it in there. Shouldn't be too complicated, though.



回答2:

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

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".

For MAMP 3.x the DefaultTabTable configuration parameter applies. It needs to be set in MAMP/bin/phpMyAdmin/config.inc.php, e.g.:

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


回答3:

Add:

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

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

You can also change LeftDefaultTabTable which changes the icon. The options are:

  • 'tbl_structure.php' = fields list
  • 'tbl_sql.php' = SQL form
  • 'tbl_select.php' = search page
  • 'tbl_change.php' = insert row page
  • 'sql.php' = browse page


回答4:

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.

In the /phpmyadmin/libraries/config.default.php file there is a section of code that handles how the table is viewed.

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.

Hope that helps!



回答5:

In version 3.5.1: go to the PhpMyAdmin home page -> Settings -> Navigation Frame -> Tables tab. 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.

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.



回答6:

navigation.php Around Line #646 in phpMyAdmin version 3.3.8 Insert

$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.



回答7:

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. I changed that line to

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

On that line and it works fine for me.



回答8:

In 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.



回答9:

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). In my config file, I added it to the "Left frame setup" section, around line 160.



回答10:

Depending on the phpMyAdmin version either of these should work:

$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. Go ot the phpmyadmin home and click Settings -> Navigation Frame ->Tables -> Target for quick access icon