0

我正在尝试为多个数据库服务器设置一个中央 phpmyadmin 服务器。

正在阅读这些:

Signon 对于 localhost(phpmyadmin.example.com) 和远程服务器 (db1.example.com) 都可以正常工作,并且用户可以同时登录。我在 phpmyadmin.example.com 中创建了 phpmyadmin 数据库和 pma_* 表。但是仅在本地主机上为 sql 查询保存历史记录。当用户登录到 db1 时,他会看到以下错误:

用于处理链接表的附加功能已停用。

更多细节:

$cfg['Servers'][$i]['pmadb'] ...    OK
$cfg['Servers'][$i]['relation'] ...     not OK [ Documentation ]
General relation features: Disabled

$cfg['Servers'][$i]['table_info'] ...   not OK [ Documentation ]
Display Features: Disabled

$cfg['Servers'][$i]['table_coords'] ...     not OK [ Documentation ]
$cfg['Servers'][$i]['pdf_pages'] ...    not OK [ Documentation ]
Creation of PDFs: Disabled

$cfg['Servers'][$i]['column_info'] ...  not OK [ Documentation ]
Displaying Column Comments: Disabled
Browser transformation: Disabled

$cfg['Servers'][$i]['bookmarktable'] ...    not OK [ Documentation ]
Bookmarked SQL query: Disabled

$cfg['Servers'][$i]['history'] ...  not OK [ Documentation ]
SQL history: Disabled

$cfg['Servers'][$i]['designer_coords'] ...  not OK [ Documentation ]
Designer: Disabled

$cfg['Servers'][$i]['tracking'] ...     not OK [ Documentation ]
Tracking: Disabled

该文档说可以将历史记录保存在中央服务器中。但我做得对吗?我尝试创建另一组 pma_* 表并将 db1 配置指向它们。没有帮助。我的感觉是这种配置试图在 db1 本身中保存 db1 的历史记录,我必须在 db1 中创建 pma_* 表(我想避免)。如何将所有服务器的历史记录指向 phpmyadmin.example.com?

这是我的 config.inc.php

$i = 0;
$i++;

 * Read configuration from dbconfig-common
 * You can regenerate it using: dpkg-reconfigure -plow phpmyadmin
 */
if (is_readable('/etc/phpmyadmin/config-db.php')) {
    require('/etc/phpmyadmin/config-db.php');
}

if (!empty($dbname)) {
    /* Authentication type */
    $cfg['Servers'][$i]['auth_type'] = 'signon';
    $cfg['Servers'][$i]['SignonSession'] = 'SignonSession';
    $cfg['Servers'][$i]['SignonURL'] = 'https://phpmyadmin.example.com/console.php';
    /* Server parameters */
    if (empty($dbserver)) $dbserver = 'localhost';
    $cfg['Servers'][$i]['host'] = $dbserver;

    if (!empty($dbport)) {
        $cfg['Servers'][$i]['connect_type'] = 'tcp';
        $cfg['Servers'][$i]['port'] = $dbport;
    }
    /* Select mysqli if your server has it */
    $cfg['Servers'][$i]['extension'] = 'mysqli';
    /* Optional: User for advanced features */
    $cfg['Servers'][$i]['controluser'] = $dbuser;
    $cfg['Servers'][$i]['controlpass'] = $dbpass;
    /* Optional: Advanced phpMyAdmin features */
    $cfg['Servers'][$i]['pmadb'] = $dbname;
    $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]['designer_coords'] = 'pma_designer_coords';
    $cfg['Servers'][$i]['tracking'] = 'pma_tracking';

}

$i++;
$cfg['Servers'][$i]['verbose'] = '';
$cfg['Servers'][$i]['host'] = 'db1.example.com';
$cfg['Servers'][$i]['port'] = '';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['auth_type'] = 'signon';
$cfg['Servers'][$i]['SignonSession'] = 'SignonSession';
$cfg['Servers'][$i]['SignonURL'] = 'https://phpmyadmin.example.com/console.php';

$cfg['Servers'][$i]['pmadb'] = $dbname;
$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]['designer_coords'] = 'pma_designer_coords';
$cfg['Servers'][$i]['tracking'] = 'pma_tracking';

$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';
$cfg['QueryHistoryDB'] = true;
$cfg['DefaultLang'] = 'en-utf-8';
$cfg['ServerDefault'] = 1;
4

1 回答 1

2

我没有看到您已经配置了一个$cfg['Servers'][$i]['controlhost'],它需要告诉 phpMyAdmin 哪个服务器用于中央数据库。另请参阅http://docs.phpmyadmin.net/en/latest/config.html#cfg_Servers_controlhost。我怀疑一旦你添加了那行,你会有更好的运气。

于 2013-05-15T10:50:08.020 回答