无法在本地连接phpMyAdmin和AppEngine

时间:2015-08-15 20:44:43

标签: php mysql google-app-engine phpmyadmin google-cloud-platform

我按照these说明让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实例?

1 个答案:

答案 0 :(得分:0)

您描述的登录屏幕是GAE身份验证。它模拟登录App而不是MySQL服务器。当app.yaml具有login:required或admin标志集时,将使用该屏幕。您需要另一种方法来为MySQL服务器设置uname / pass。