Tuesday, October 6, 2020

Re: [google-cloud-sql-discuss] Re: google-cloud-sql: Name or service not known

Hye
First of all I exported mysql db from localhost created an instance on cloud mysql and then using shell imported the tables.
This is how I am creating connection

mysql_connect('/cloudsql/'.$connection_name, $username, $password, $db);

After creating a connection I run the command gcloud app deploy and deploy the connection file and index file but when I run the query I couldn,t get the data this is my query.

$query_string  = "SELECT * FROM users;";
$result = mysql_query($conn,$query_string);

but I get $result as false

On Sun, Oct 4, 2020 at 11:40 PM 'Katayoon (Cloud Platform Support)' via Google Cloud SQL discuss <google-cloud-sql-discuss@googlegroups.com> wrote:
Hi,

Could you provide more clarification on the steps you have taken to connect to the Cloud SQL instance? 

Are you trying to connect to the instance from your App Engine app? If so, you may double check the steps you have taken with this public documentation and if the issue still persists we need the REDACTED app.yaml to dig into the issue. 


On Saturday, October 3, 2020 at 7:45:04 PM UTC-4 alijut...@gmail.com wrote:
Hye 
I want to connect mysql db with my php project I have created the db and uploaded the project but unable to get data or run any query Here is what I get the error when I var_dump my connection variable

object(mysqli)#1 (19) {
  ["affected_rows"]=&gt;
  bool(false)
  ["client_info"]=&gt;
  bool(false)
  ["client_version"]=&gt;
  int(50012)
  ["connect_errno"]=&gt;
  int(2002)
  ["connect_error"]=&gt;
  string(71) "php_network_getaddresses: getaddrinfo failed: Name or service not known"
  ["errno"]=&gt;
  bool(false)
  ["error"]=&gt;
  bool(false)
  ["error_list"]=&gt;
  bool(false)
  ["field_count"]=&gt;
  bool(false)
  ["host_info"]=&gt;
  bool(false)
  ["info"]=&gt;
  bool(false)
  ["insert_id"]=&gt;
  bool(false)
  ["server_info"]=&gt;
  bool(false)
  ["server_version"]=&gt;
  bool(false)
  ["stat"]=&gt;
  bool(false)
  ["sqlstate"]=&gt;
  bool(false)
  ["protocol_version"]=&gt;
  bool(false)
  ["thread_id"]=&gt;
  bool(false)
  ["warning_count"]=&gt;
  bool(false)
}

--
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/76994535-760c-48e8-9183-b5f3e94b300en%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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/CAA5zD%2BNWPTEZsQQEjwTeiXV8DEPc2MxFQz83bW-2Kfqm8cALWg%40mail.gmail.com.

No comments:

Post a Comment