-
Notifications
You must be signed in to change notification settings - Fork 344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot Connect to Cloud SQL from Compute Engine via Proxy using PHP/PDO #42
Comments
It sounds similar to #7? Are you using |
Are you still having trouble? |
Please reopen if you have any more thoughts or information for me to help debug. |
Hi @syclone, did you find a way to solve this problem? I have exactly the same problem than you and I would like you explain me how did you fix it please. Thanks. |
As suggested in a comment above, did you try just using `-instances`? -fuse
is nice for development but not well tested for longevity.
|
Nothing I tried at the time worked. I switched to just using the IP address
and called it a day. I haven't tried since then. Sorry.
…On Thu, Feb 15, 2018 at 10:51 AM, Kevin Malachowski < ***@***.***> wrote:
As suggested in a comment above, did you try just using `-instances`? -fuse
is nice for development but not well tested for longevity.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#42 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AQEH98sAVtsRCfOaLtrAiUDRaOfXewZlks5tVFKegaJpZM4JV2AF>
.
|
Hi @Carrotman42. Thanks for your answer :) I tried these two commands : But I don't know what is exactly the credential_file. I'm running on CentOS 7 in a compute engine from Google Cloud Platform. I want to access to one mysql database on the Cloud SQL (from Google Cloud as well). I can access to this one by command line but not with my Laravel application which use PDO. This command works to connect me on the database directly from my instance : Thanks. |
Sorry to hear about your experience. If you ever try again and would like
some assistance, please don't hesitate to open up a new issue explaining
what you tried and what didn't work (along with example code along with any
errors you encountered).
|
Whoops, in my previous message I was confused about who was responding!
Thanks for following up Syclone.
Philippe: have you looked through this documentation? It describes the
credential_file, as well as other options:
https://cloud.google.com/sql/docs/mysql/sql-proxy#authentication-options
On Feb 15, 2018 8:17 AM, "Kevin Malachowski" <notifications@github.com> wrote:
Sorry to hear about your experience. If you ever try again and would like
some assistance, please don't hesitate to open up a new issue explaining
what you tried and what didn't work (along with example code along with any
errors you encountered).
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#42 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAiy7z7km59BmRThr1oO_nfDYi-h7eFxks5tVFiGgaJpZM4JV2AF>
.
|
@Carrotman42, yes I already read this documentation. But I read is not necessary to use this file if I am connecting to Cloud SQL from a Compute Engine instance. It's the case for me, then the database instance and the compute engine instance are on the same project on Google Cloud Platform. So for me it's good, I think the proxy is correctly setted up because I can connect me to the database by command line. The problem is when I want to access to the database with my Laravel application, I have the following error : I tried everything and I don't know why it still doesn't work :( Philippe |
Would you mind opening up a new issue? It's tricky to keep track if we are
chatting on a different issue.
…On Feb 15, 2018 8:49 AM, "Philippe Mothais" ***@***.***> wrote:
@Carrotman42 <https://github.com/carrotman42>, yes I already read this
documentation. But I read is not necessary to use this file if I am
connecting to Cloud SQL from a Compute Engine instance. It's the case for
me, then the database instance and the compute engine instance are on the
same project on Google Cloud Platform.
So for me it's good, I think the proxy is correctly setted up because I
can connect me to the database by command line. The problem is when I want
to access to the database with my Laravel application, I have the following
error :
SQLSTATE[HY000] [2002] Permission denied
I tried everything and I don't know why it still doesn't work :(
Philippe
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#42 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAiy79sCL9hkZCa3AAj6WZbLk62J9luTks5tVF_ggaJpZM4JV2AF>
.
|
@Carrotman42 The issue described by @pmothais sounds exactly the same.
|
Very sorry for the noise everyone, I agree that they sound similar and that
it might just be better off re-opened instead. Or, if this really is just
another instance of #7 then I'm not sure there's anything we can do for you
right now other than just using the -instances flag.
|
Provide a Dockerfile for obsolete google/ruby images.
I am having an issue connecting to the proxy with PHP/PDO. I followed all the instructions on this page https://cloud.google.com/sql/docs/compute-engine-access and I am able to connect with
mysql -u root -p -S /cloudsql/projectid:region:instance
and confirm withshow databases;
. Now my issue when I connect with the PDO I get :SQLSTATE[HY000] [2002] Permission denied
The DSN I am trying to connect with is
mysql:unix_socket=/cloudsql/<projectid>:<region>:<instance>;dbname=<dbname>;charset=utf8.
with password.How did you get this to work with PHP? I am able to confirm that the proxy is connecting in terminal. I am trying to get this to work with PDO running on CentOS. Is this related to Issue: #7?
Thanks
The text was updated successfully, but these errors were encountered: