Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [2002] No such file or directory'
<?phpini_set('display_errors', 1);ini_set('display_startup_errors', 1);$pdo = new PDO('mysql:unix_socket=/cloudsql/<your-project-id>:<your-instance-name>;dbname=db',
'db', 'db');$statement = $pdo->query("SHOW TABLES;");$row = $statement->fetch(PDO::FETCH_ASSOC);echo htmlentities($row['_message']);?>
--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/411eb6c1-fafa-4613-812d-b36728f447d6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Where are you running your application? On your local machine?The socket name should be project_id:region:instance_name.You should be able to run "ls /cloudsql" and see the sockets there.
On Mon, Mar 14, 2016 at 9:19 AM <wob...@yblew.com> wrote:
I tried to connect to database in PHP using PDO and Cloud SQL Proxy but have no luck. I keep getting--
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [2002] No such file or directory'
Im using
<?phpini_set('display_errors', 1);ini_set('display_startup_errors', 1);$pdo = new PDO('mysql:unix_socket=/cloudsql/<your-project-id>:<your-instance-name>;dbname=db','db','db');$statement = $pdo->query("SHOW TABLES;");$row = $statement->fetch(PDO::FETCH_ASSOC);echo htmlentities($row['_message']);?>
Has anyone had any luck connecting
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsub...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/411eb6c1-fafa-4613-812d-b36728f447d6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/02317d1f-a4d1-467e-bff3-2132901a0ded%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/411eb6c1-fafa-4613-812d-b36728f447d6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsub...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/411eb6c1-fafa-4613-812d-b36728f447d6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/02317d1f-a4d1-467e-bff3-2132901a0ded%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/ce76a1fc-2c41-4a64-ae8d-9f9279ecf8e0%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/411eb6c1-fafa-4613-812d-b36728f447d6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/02317d1f-a4d1-467e-bff3-2132901a0ded%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsub...@googlegroups.com.
Kevin, I think it worked. Will do more testing and update you2016/03/14 18:56:37 Got a connection for "<your-project-id>:<the-region>:<your-instance-name>"2016/03/14 18:56:37 from "<your-project-id>:<the-region>:<your-instance-name>" via IP:3307: read tcp IP->IP:3307: use of closed network connectionBut two things:1. What is really the purpose of CREATE USER name_of_user@'cloudsqlproxy~%'; in your documentation. I'm still a bit confused about it? I should be able to login using regular mysql username and password from php right Or I need to have that?
2. How do I silent the print out from proxy and how can I keep the command running even after server reboot?
To your question, yes I’m replacing the ips and ports
- So to confirm, using fuse with PDO is not advised right? When I set it up with fuse, I see a “README” file in my /cloudsql directory with error (no such file or directory) but when I set it up with “-instances” I see <your-project-id>:<the-region>:<your-instance-name> file in /cloudsql directory with a successful connection
- Let’s say I want access to multiple instances how will I achieve that?
- When you say “Note that you don't specify the hostname when connecting to a Cloud SQL instance (using the proxy or not using the proxy), it is inferred by the database itself when a new connection comes in.” what do you mean? Just a reminder that I’m running the proxy on a on premise server to connect to my instance in google cloud sql.
- How stable is the proxy sql. Does it hang sometimes? Can I expect to run this on production?
- When I create name_of_user@'cloudsqlproxy~% in mysql, I don’t need to assign any privileges to the database I need right?
- When I create name_of_user@'cloudsqlproxy~% is that the username with no password I use to connect to my db in my php code?
Just a suggestion. I think the common name of the ssl certificate on the cloud sql instance should be a name with no colon; set of alphanumeric ASCII characters (a-z, A-Z, 0-9). Let me tell you why. When I tried to first access the db with PHP/PDO and ssl certificates, it failed peer validation which makes sense because you guys use CN and IP that does not match. If the CN was without colon maybe I can map the ip and the CN in my hosts file so that when peer validation is done, it can check my hosts file before it touches the DNS and pass. This would have been a quick fix instead of people moving to AWS RDS or waiting for PHP to implement CLIENT_SSL_DONT_VERIFY_SERVER_CERT. (https://bugs.php.net/bug.php?id=71003)
Thanks your for help
On Monday, March 14, 2016 at 7:37:04 PM UTC-4, Kevin Malachowski wrote:Just a quick question: are you actually swapping in your project id, the region of your instance, and the instances name? I can't tell if you're copy-pasting and manually redacting your project/region/instance (I agree, you shouldn't be posting this info on this public forum) or if you're literally trying to connect to "<your-project-id>:<the-region>:<your-instance-name>".Answers to your questions inline:On Mon, Mar 14, 2016 at 4:05 PM, <wob...@yblew.com> wrote:Kevin, I think it worked. Will do more testing and update you2016/03/14 18:56:37 Got a connection for "<your-project-id>:<the-region>:<your-instance-name>"2016/03/14 18:56:37 from "<your-project-id>:<the-region>:<your-instance-name>" via IP:3307: read tcp IP->IP:3307: use of closed network connectionBut two things:1. What is really the purpose of CREATE USER name_of_user@'cloudsqlproxy~%'; in your documentation. I'm still a bit confused about it? I should be able to login using regular mysql username and password from php right Or I need to have that?If you are using the proxy, you should create a user with a hostname 'cloudsqlproxy~%'; this user will only be available for connections that come in through the proxy. It is not strictly required but it is definitely suggested because it is safe to create this user without a password regardless of the firewall configuration of your instance.Note that you don't specify the hostname when connecting to a Cloud SQL instance (using the proxy or not using the proxy), it is inferred by the database itself when a new connection comes in.2. How do I silent the print out from proxy and how can I keep the command running even after server reboot?The proxy prints out its logs on standard error. You can redirect this output to a file named 'proxy.log' by doing something like this:./cloud_sql_proxy YOUR_OTHER_ARGUMENTS_HERE 2>proxy.log &(the '&' causes the process to run in the background)On unix-like systems, you can cause the output to be ignored by redirecting it to the file located at '/dev/null'. I suggest writing the output to a file or somehow hooking into your system's logging infrastructure, though. It will be easier to debug problems you may encounter in the future when you have access to the logs that the proxy writes.As for keeping the proxy up after a reboot, you can configure your system to run the proxy when the server starts up. Every system is different, so I can't give specific advice unless you give more info about your specific server. For example, can you find other services that run on startup that you can model after? I find that searching the internet for your operating system along with something along the lines of "run program on startup" yields good results.
--
You received this message because you are subscribed to a topic in the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-cloud-sql-discuss/AsVdpcRF5gA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-cloud-sql-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/6330a422-365f-4069-b2ff-f764e2b09371%40googlegroups.com.
I would like to help you get FUSE working on your setup, it is a nicer experience than listing instances on the command line. If you are able to get things to work with the '-instances' flag, I suggest replacing the '-instances' flag with '-fuse' and trying again (without changing your PHP app). What does the proxy write out when your PHP server tries to access the /cloudsql directory when '-fuse' is passed to the proxy?
I get “no file or directory” error. Is as if php/pdo need to see the file there. Question, I’m using CentOs 7. besides “yum install fuse”, is there any packages I’m missing?
You don't have to create a user that has a hostname of `cloudsqlproxy~%`, but it is suggested that you create that user and use the user when using the proxy. It will decrease the chance of accidentally opening up your database to access that you didn't mean to. I can be more specific about an example of accidental misconfiguration if you want.
can you give me an example :) I like to learn:)
I will do more tests and update you
To unsubscribe from this group and all its topics, send an email to google-cloud-sql-discuss+unsub...@googlegroups.com.
On Mon, Mar 14, 2016 at 11:42 PM, <wob...@yblew.com> wrote:To your question, yes I’m replacing the ips and ports
- So to confirm, using fuse with PDO is not advised right? When I set it up with fuse, I see a “README” file in my /cloudsql directory with error (no such file or directory) but when I set it up with “-instances” I see <your-project-id>:<the-region>:<your-instance-name> file in /cloudsql directory with a successful connection
I don't know if we can say that, yet. A teammate tried to reproduce your issue using FUSE with PDO (right, Vadim?), so it doesn't appear to be a specific issue with FUSE. The fact that you only see the README is not a bad thing; FUSE allows the proxy to create a file in that directory right when something else tries to access a file in that directory. Any file you try to access should appear to be there (try running `ls /cloudsql/asdfasdfasdfas`, it should show up as a symbolic link (but of course if you try to connect to that socket things won't work, as it isn't a correctly formatted name)). Therefore it is suspect to me that the error you got was 'no such file or directory', as (as far as I can remember) that should never happen unless something is misconfigured somehow.
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/CAB%3DH8NWDLaKB1dRUChwacJw0hh0vw6C7AnmQvvb1%2Bzq51GF5cg%40mail.gmail.com.
To unsubscribe from this group and all its topics, send an email to google-cloud-sql-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/6330a422-365f-4069-b2ff-f764e2b09371%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/99cf2b0d-8e18-4535-a479-31bc20979646%40googlegroups.com.
To unsubscribe from this group and all its topics, send an email to google-cloud-sql-discuss+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/6330a422-365f-4069-b2ff-f764e2b09371%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsub...@googlegroups.com.
To unsubscribe from this group and all its topics, send an email to google-cloud-sql-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/6330a422-365f-4069-b2ff-f764e2b09371%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/99cf2b0d-8e18-4535-a479-31bc20979646%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/08f0e3c7-f9f5-439f-a174-ccad77c2f260%40googlegroups.com.
To add to my previous post what is the right way to stop the socket? just kill the pid?
On Tuesday, March 15, 2016 at 6:21:14 AM UTC-4, wob...@yblew.com wrote:I would like to help you get FUSE working on your setup, it is a nicer experience than listing instances on the command line. If you are able to get things to work with the '-instances' flag, I suggest replacing the '-instances' flag with '-fuse' and trying again (without changing your PHP app). What does the proxy write out when your PHP server tries to access the /cloudsql directory when '-fuse' is passed to the proxy?
I get “no file or directory” error. Is as if php/pdo need to see the file there. Question, I’m using CentOs 7. besides “yum install fuse”, is there any packages I’m missing?
You don't have to create a user that has a hostname of `cloudsqlproxy~%`, but it is suggested that you create that user and use the user when using the proxy. It will decrease the chance of accidentally opening up your database to access that you didn't mean to. I can be more specific about an example of accidental misconfiguration if you want.
can you give me an example :) I like to learn:)
I will do more tests and update you
To unsubscribe from this group and all its topics, send an email to google-cloud-sql-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/6330a422-365f-4069-b2ff-f764e2b09371%40googlegroups.com.
--
You received this message because you are subscribed to a topic in the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-cloud-sql-discuss/AsVdpcRF5gA/unsubscribe.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/99cf2b0d-8e18-4535-a479-31bc20979646%40googlegroups.com.To unsubscribe from this group and all its topics, send an email to google-cloud-sql-d...@googlegroups.com.
To unsubscribe from this group and all its topics, send an email to google-cloud-sql-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/6330a422-365f-4069-b2ff-f764e2b09371%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/99cf2b0d-8e18-4535-a479-31bc20979646%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/08f0e3c7-f9f5-439f-a174-ccad77c2f260%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/e3c65a6c-3cd6-4789-bc8a-fbc30316624c%40googlegroups.com.
But you're not running the apache server under a docker container, or anything like that, right?I installed just the basic packages: php-cli, php-mysql, php-pdo, fusePlease watch https://github.com/GoogleCloudPlatform/cloudsql-proxy/issues/4 for future updates about example service configs.
On Tue, Mar 15, 2016 at 12:53 PM <wob...@yblew.com> wrote:
Thank you both.Kevin : The example was great!Vadim:hmm that's odd...I'm testing this under apache/php/pdo, not on google clouddid you install any packages on your server?Also When can I expect the service script?--
On Tuesday, March 15, 2016 at 3:49:53 PM UTC-4, Vadim Berezniker wrote:It works for me on a clean CentOS 7.2 install.How are you running your test script? Command line? Under a server?Is your PHP server running directly in the VM or is it running in a container?
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsub...@googlegroups.com.
Vadim:Were you able to reproduce the issue?
On Tuesday, March 15, 2016 at 4:03:10 PM UTC-4, wob...@yblew.com wrote:
But you're not running the apache server under a docker container, or anything like that, right? --> CorrectWhen I do php index.php on the command line it WORKS but not when I call it from apache/php, I get : Connection failed: SQLSTATE[HY000] [2002] No such file or directory
On Tuesday, March 15, 2016 at 3:59:27 PM UTC-4, Vadim Berezniker wrote:
But you're not running the apache server under a docker container, or anything like that, right?I installed just the basic packages: php-cli, php-mysql, php-pdo, fusePlease watch https://github.com/GoogleCloudPlatform/cloudsql-proxy/issues/4 for future updates about example service configs.
On Tue, Mar 15, 2016 at 12:53 PM <wob...@yblew.com> wrote:
Thank you both.Kevin : The example was great!Vadim:hmm that's odd...I'm testing this under apache/php/pdo, not on google clouddid you install any packages on your server?Also When can I expect the service script?--
On Tuesday, March 15, 2016 at 3:49:53 PM UTC-4, Vadim Berezniker wrote:It works for me on a clean CentOS 7.2 install.How are you running your test script? Command line? Under a server?Is your PHP server running directly in the VM or is it running in a container?
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/e3c65a6c-3cd6-4789-bc8a-fbc30316624c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/2811c05d-72b6-463c-81b0-a8de76e28989%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/e3c65a6c-3cd6-4789-bc8a-fbc30316624c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsub...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/e3c65a6c-3cd6-4789-bc8a-fbc30316624c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/2811c05d-72b6-463c-81b0-a8de76e28989%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/519fa903-49db-4800-93db-31abb918606c%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/e3c65a6c-3cd6-4789-bc8a-fbc30316624c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/2811c05d-72b6-463c-81b0-a8de76e28989%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsub...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/e3c65a6c-3cd6-4789-bc8a-fbc30316624c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/2811c05d-72b6-463c-81b0-a8de76e28989%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/519fa903-49db-4800-93db-31abb918606c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/bbf00a38-96ac-4509-ae11-0edc590f7954%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/e3c65a6c-3cd6-4789-bc8a-fbc30316624c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/2811c05d-72b6-463c-81b0-a8de76e28989%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/519fa903-49db-4800-93db-31abb918606c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsub...@googlegroups.com.
So after you disabled Selinux it worked for you?
--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/58c2ac04-1a5e-4c47-91fc-2d3fa3116925%40googlegroups.com.
sudo ./cloud_sql_proxy -dir=/cloudsql -instances=my-project:us-central1:sql-inst=tcp:3308 -credential_file=/root/developmentDB.json &
./cloud_sql_proxy -dir=/cloudsql -instances=my-project:us-central1:sql-inst &
mysql -u <user_name> -S /cloudsql/my-project:us-central1:sql-inst
On Wednesday, March 16, 2016 at 5:07:10 PM UTC-4, Vadim Berezniker wrote:No, I see the same problem. I filed an issue to investigate: https://github.com/GoogleCloudPlatform/cloudsql-proxy/issues/7Can you use the non-fuse mode as a workaround until the issue is resolved?
On Wed, Mar 16, 2016 at 1:46 PM <wob...@yblew.com> wrote:
So after you disabled Selinux it worked for you?
--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsub...@googlegroups.com.
It seems the only thing stable is below, however it seems I have to assign all databases in mysql to dev@'cloudsqlproxy~%' user before I can see interact with database through the proxy via non socket which is weird; can you confirm? I checked developmentDB.json and it's an editor of all my insitances. If I remember correctly, Kevin said I don't have to assign dev@'cloudsqlproxy~%' to anything, just create it and i'm all set.
sudo ./cloud_sql_proxy -dir=/cloudsql -instances=my-project:us-central1:sql-inst=tcp:3308 -credential_file=/root/developmentDB.json &I also tried below for php/mysqli and got permission denied on the browser but it worked for php/pdo in browser
./cloud_sql_proxy -dir=/cloudsql -instances=my-project:us-central1:sql-inst &
mysql -u <user_name> -S /cloudsql/my-project:us-central1:sql-instOn Wednesday, March 16, 2016 at 5:07:10 PM UTC-4, Vadim Berezniker wrote:
No, I see the same problem. I filed an issue to investigate: https://github.com/GoogleCloudPlatform/cloudsql-proxy/issues/7Can you use the non-fuse mode as a workaround until the issue is resolved?
On Wed, Mar 16, 2016 at 1:46 PM <wob...@yblew.com> wrote:
So after you disabled Selinux it worked for you?
--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/58c2ac04-1a5e-4c47-91fc-2d3fa3116925%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-cloud-sql-discuss/AsVdpcRF5gA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-cloud-sql-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/b9f94b0d-6647-4ca4-9892-ae818f17cdeb%40googlegroups.com.
Sorry for the delay.I'm a little confused by your question but I'll try to answer what I think you're asking. Feel free to ask again if I missed the mark.If you create a user dev@'cloudsqlproxy~%' in a database named 'sql-inst' in 'us-central1' in the project 'my-project', then you can connect to that instance using the following 'mysql' command (while the proxy is running on that machine):mysql -u dev -S /cloudsql/my-project:us-central1:sql-instThe user that has the 'cloudsqlproxy~%' hostname is the one you want to provide as the '-u' flag (short for --user).For your PHP/PDO script, it appears that the second parameter of the constructor is the username [0]. In your original post you put 'db' for this value; given a dev@'cloudsqlproxy~%' user, you should use 'dev' instead.
On Wed, Mar 16, 2016 at 9:48 PM, <wob...@yblew.com> wrote:
It seems the only thing stable is below, however it seems I have to assign all databases in mysql to dev@'cloudsqlproxy~%' user before I can see interact with database through the proxy via non socket which is weird; can you confirm? I checked developmentDB.json and it's an editor of all my insitances. If I remember correctly, Kevin said I don't have to assign dev@'cloudsqlproxy~%' to anything, just create it and i'm all set.
sudo ./cloud_sql_proxy -dir=/cloudsql -instances=my-project:us-central1:sql-inst=tcp:3308 -credential_file=/root/developmentDB.json &I also tried below for php/mysqli and got permission denied on the browser but it worked for php/pdo in browser
./cloud_sql_proxy -dir=/cloudsql -instances=my-project:us-central1:sql-inst &
mysql -u <user_name> -S /cloudsql/my-project:us-central1:sql-instOn Wednesday, March 16, 2016 at 5:07:10 PM UTC-4, Vadim Berezniker wrote:
No, I see the same problem. I filed an issue to investigate: https://github.com/GoogleCloudPlatform/cloudsql-proxy/issues/7Can you use the non-fuse mode as a workaround until the issue is resolved?
On Wed, Mar 16, 2016 at 1:46 PM <wob...@yblew.com> wrote:
So after you disabled Selinux it worked for you?
--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/58c2ac04-1a5e-4c47-91fc-2d3fa3116925%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-cloud-sql-discuss/AsVdpcRF5gA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-cloud-sql-discuss+unsub...@googlegroups.com.
I double checked and it's still not working. I can connect to it using mysql on the command line but not via PHP/PDO
On Monday, March 14, 2016 at 4:41:10 PM UTC-4, Vadim Berezniker wrote:Can you double check the instance connection string?You should use the value that is shown as the "instance connection string" on the instance page in the Developer Console.On Mon, Mar 14, 2016 at 9:48 AM <wob...@yblew.com> wrote:sudo ./cloud_sql_proxy -dir=/cloudsql -fuse -credential_file=/root/developmentDB.json &[1] 31266[root@dev /]# 2016/03/14 12:46:39 couldn't unmount fuse directory "/cloudsql": &errors.errorString{s:"exit status 1: fusermount: failed to unmount /cloudsql: Invalid argument"}2016/03/14 12:46:39 Mounting "/cloudsql"...2016/03/14 12:46:39 Mounted "/cloudsql"2016/03/14 12:46:39 Socket prefix: /cloudsql
On Monday, March 14, 2016 at 12:40:43 PM UTC-4, Vadim Berezniker wrote:What is the command you are using to start the proxy?On Mon, Mar 14, 2016 at 9:31 AM <wob...@yblew.com> wrote:ls /cloudsql give me README.I changed the socket name to "project_id:region:instance_name. " but no luck
On Monday, March 14, 2016 at 12:25:13 PM UTC-4, Vadim Berezniker wrote:Where are you running your application? On your local machine?The socket name should be project_id:region:instance_name.You should be able to run "ls /cloudsql" and see the sockets there.On Mon, Mar 14, 2016 at 9:19 AM <wob...@yblew.com> wrote:I tried to connect to database in PHP using PDO and Cloud SQL Proxy but have no luck. I keep getting
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [2002] No such file or directory'
Im using
<?phpini_set('display_errors', 1);ini_set('display_startup_errors', 1);$pdo = new PDO('mysql:unix_socket=/cloudsql/<your-project-id>:<your-instance-name>;dbname=db','db','db');$statement = $pdo->query("SHOW TABLES;");$row = $statement->fetch(PDO::FETCH_ASSOC);echo htmlentities($row['_message']);?>
Has anyone had any luck connecting
--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/411eb6c1-fafa-4613-812d-b36728f447d6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/02317d1f-a4d1-467e-bff3-2132901a0ded%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/ce76a1fc-2c41-4a64-ae8d-9f9279ecf8e0%40googlegroups.com.