在本地连接phpMyAdmin和AppEngine时遇到问题


Having trouble connecting phpMyAdmin and AppEngine locally

我按照这些说明让phpMyAdmin在AppEngine上工作。但是,我不能让它在本地工作。以下是我尝试的config.inc.php文件:

$cfg['blowfish_secret'] = 'ZZZZZZZZZ';
/*
 * Servers configuration
 */
$i = 0;
$isGAE = isset($_SERVER['SERVER_SOFTWARE']) &&
         strpos($_SERVER['SERVER_SOFTWARE'],'Google App Engine') !== false;
/*
* First server
*/
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
if ($isGAE) {
    $cfg['Servers'][$i]['socket'] = '/cloudsql/XXXXXX:YYYYYY';
    $cfg['Servers'][$i]['connect_type'] = 'socket';
} else {
    $cfg['Servers'][$i]['verbose'] = 'localhost';
    $cfg['Servers'][$i]['host'] = 'localhost';
    $cfg['Servers'][$i]['socket'] = '';
    $cfg['Servers'][$i]['port'] = '';
    $cfg['Servers'][$i]['connect_type'] = 'tcp';
}
$cfg['Servers'][$i]['compress'] = false;
/* Select mysql if your server does not have mysqli */
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
/*
 * End of servers configuration
 */
/*
 * Directories for saving/loading files from server
 */
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';
/*
* Other settings
*/
$cfg['PmaNoRelation_DisableWarning'] = true;
$cfg['ExecTimeLimit'] = 60;
$cfg['CheckConfigurationPermissions'] = false;

当我在目录中运行dev_appserver.py .时,它运行并且我得到一个"未登录"屏幕,其中包含test@example.com。我选中"管理员"框,然后尝试输入我的本地根凭据。但是,它告诉我"无法登录到MySQL服务器"。当我在本地运行mysql -u root -p时,可以使用相同的密码成功登录。

任何想法?有没有可能现有的教程可以扩展到谈论连接到本地mysql实例?

您描述的登录屏幕是用于GAE验证的。它模拟登录到应用程序,而不是你的MySQL服务器。当app.yaml设置了login: required或admin标志时,使用该屏幕。您需要另一种方法来设置MySQL服务器的uname/pass。