GAE PHP不会连接到云端SQL [英] GAE PHP won't connect to Cloud SQL

查看:91
本文介绍了GAE PHP不会连接到云端SQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用mysqli似乎无法让GAE PHP连接到云端SQL,因此无法找到套接字传输unix - 您是否忘记在配置PHP时启用它?

Can't seem to get GAE PHP to connect to Cloud SQL, using mysqli, says: Unable to find the socket transport "unix" - did you forget to enable it when you configured PHP?

我已经授权应用程序并确保它们都在同一区域,即美国

I've authorized the app and made sure they're both in the same region i.e US

任何想法都会很棒,谢谢

any ideas would be great, thanks

$mysqli = new mysqli(null, "USERNAME", "PASSWORD", "DATABASE", null,
"/cloudsql/PROJECT_NAME:db2");

当我使用:/ cloudsql / PROJECT_NAME:db2它说'sock'有错误

when i use :/cloudsql/PROJECT_NAME:db2 it's saying there's error with 'sock'

当我使用/ cloudsql / PROJECT_NAME:db2 without:它说不能连接到user @ localhost

When i use /cloudsql/PROJECT_NAME:db2 without : it's saying cannot connect to user@localhost

推荐答案

如果您使用的是默认身份验证,请尝试使用root作为用户名,null作为密码,并使用云SQL面板中列出的实例ID,如此。示例:

If you are using default authentication, try using "root" as the username, null as password, and the instance-id listed in the Cloud SQL panel, like so. Example:

$conn = new mysqli(null, "root", null, "<databasename>", null, "/cloudsql/<instance id>");

这篇关于GAE PHP不会连接到云端SQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆