Tuesday, September 20, 2016

Re: [google-cloud-sql-discuss] Automating Google SQL queries in Cloud Shell

Thanks for the help!  I tried connecting through the mysql client (using the command mysql -uroot -p then entering the password and hitting "enter" when prompted) however I always get an "ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)", even if I specify the host "-h 127.0.0.1".  I've also tried non-root access to no avail.  Any thoughts on how to continue troubleshooting this?

Thanks,
Mike

On Sunday, September 18, 2016 at 7:31:36 PM UTC-4, Vadim Berezniker wrote:
gcloud sql connect launches the stock 'mysql' client. 
You can read the guidance here on ways of passing a password to the mysql client: http://dev.mysql.com/doc/refman/5.6/en/password-security-user.html


On Sun, Sep 18, 2016 at 8:11 AM Mike Dorfman <mdor...@mountwashington.org> wrote:
Hi!

I have a project which requires me to automate a select statement on a Google SQL database and FTP the result to a client.  It seems like the only way to connect through Cloud Shell is via "gcloud beta sql connect my-instance --user=readOnlyUser".  This then prompts for a password and I can perform queries through the command line.  What's the best way to safely (and securely) automate this process so I can run a query once an hour through Cron?

Thanks,
Mike

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/25467919-bd6f-415c-ba0d-b9fb48099e0d%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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/643fe501-d16a-4c82-85c5-b520d42a06d7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment