是Google Cloud SQL的新手。我刚刚在Cloud Console中创建了一个实例。

现在,我想通过本地主机phpMyAdmin连接到该实例。但是CloudSQL没有要配置的任何主机名。它只有IPV6地址。因此,对于执行该操作几乎不感到困惑。我已经尝试过使用ipv6地址编辑'config.inc.php'文件。但这给了我下面的错误


  2002年-php_network_getaddresses:getaddrinfo失败:此类主机未知。
  
  服务器没有响应(或未正确配置本地服务器的套接字)。


我的配置文件详细信息如下

$i++;
$cfg['Servers'][$i]['verbose'] = '*****';
$cfg['Servers'][$i]['host'] = '2001:4860:4864:1:****:****:***:****';
$cfg['Servers'][$i]['port'] = '';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '**********';
$cfg['Servers'][$i]['AllowNoPassword'] = true;

最佳答案

正如胡安·恩里克(Juan Enrique)所指出的那样,您可以(并且在这种情况下肯定应该)使用IPv4而不是IPv6协议。

其值刚刚在Cloud SQL概述页面的IPv6值上方列出。

另外,请不要忘记在“编辑”页面中授权本地IP访问该Cloud SQL实例,否则您将无法连接。

关于mysql - 通过本地phpMyAdmin的Google Cloud SQL实例,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/28436524/

10-12 00:02
查看更多