Error with $conn = mysql_connect(":/cloudsql/...

已查看 332 次
跳至第一个未读帖子

Hans Simtanda Caspersen

未读,
2013年10月6日 23:22:412013/10/6
收件人 google-cloud...@googlegroups.com
Hi, 

im working at http://abcategories-com.appspot.com/ and i am ALSO using this script: 

<?php $conn = mysql_connect(":/cloudsql/abcategories-com:authorbooksdatabase", "username", "password"); ?> 

...to connect to my Cloud SQL, but i am getting no reaction online! 

And on my local web server (PHP SDK) i am getting the following error: 

Warning: mysql_connect(): No connection could be made because the target machine actively refused it. in C:\Google APP Sites\ABCategories\helloworld.php on line 21

Razvan Musaloiu-E.

未读,
2013年10月6日 23:47:322013/10/6
收件人 google-cloud...@googlegroups.com
The '/cloudsql/...' only works on app server (and not dev app server). What error do you see in the appengine logs for your application?

-- Razvan ME


--
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/1962436c-80e3-4043-9a85-200694833f40%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hans Simtanda Caspersen

未读,
2013年10月7日 00:02:202013/10/7
收件人 google-cloud...@googlegroups.com
I have attached a log and it seems that there is no error or what?


On Monday, October 7, 2013 5:47:32 AM UTC+2, Razvan Musaloiu-E. wrote:
The '/cloudsql/...' only works on app server (and not dev app server). What error do you see in the appengine logs for your application?

-- Razvan ME
On Sun, Oct 6, 2013 at 8:22 PM, Hans Simtanda Caspersen <ad...@simtanda.com> wrote:
Hi, 

im working at http://abcategories-com.appspot.com/ and i am ALSO using this script: 

<?php $conn = mysql_connect(":/cloudsql/abcategories-com:authorbooksdatabase", "username", "password"); ?> 

...to connect to my Cloud SQL, but i am getting no reaction online! 

And on my local web server (PHP SDK) i am getting the following error: 

Warning: mysql_connect(): No connection could be made because the target machine actively refused it. in C:\Google APP Sites\ABCategories\helloworld.php on line 21

--
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.
log.jpg

Razvan Musaloiu-E.

未读,
2013年10月7日 00:11:072013/10/7
收件人 google-cloud...@googlegroups.com
What does mysql_error() says?

-- Razvan ME


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/5114b26f-f5c5-4949-bf24-19e04f6cc2e1%40googlegroups.com.

Hans Simtanda Caspersen

未读,
2013年10月7日 00:20:532013/10/7
收件人 google-cloud...@googlegroups.com
I have attached another log file form mysql prompt and there is no errors regarding connect


On Monday, October 7, 2013 6:11:07 AM UTC+2, Razvan Musaloiu-E. wrote:
What does mysql_error() says?

-- Razvan ME
On Sun, Oct 6, 2013 at 9:02 PM, Hans Simtanda Caspersen <ad...@simtanda.com> wrote:
I have attached a log and it seems that there is no error or what?


On Monday, October 7, 2013 5:47:32 AM UTC+2, Razvan Musaloiu-E. wrote:
The '/cloudsql/...' only works on app server (and not dev app server). What error do you see in the appengine logs for your application?

-- Razvan ME
On Sun, Oct 6, 2013 at 8:22 PM, Hans Simtanda Caspersen <ad...@simtanda.com> wrote:
Hi, 

im working at http://abcategories-com.appspot.com/ and i am ALSO using this script: 

<?php $conn = mysql_connect(":/cloudsql/abcategories-com:authorbooksdatabase", "username", "password"); ?> 

...to connect to my Cloud SQL, but i am getting no reaction online! 

And on my local web server (PHP SDK) i am getting the following error: 

Warning: mysql_connect(): No connection could be made because the target machine actively refused it. in C:\Google APP Sites\ABCategories\helloworld.php on line 21

--
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+unsubscr...@googlegroups.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.
log.jpg

Razvan Musaloiu-E.

未读,
2013年10月7日 00:54:452013/10/7
收件人 google-cloud...@googlegroups.com
mysql_error() is a PHP function you can call after mysql_connect [1]. Do you mind showing us the code you use to connect?



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/08dffffd-20db-4ec4-8a0c-fc9921ddeb54%40googlegroups.com.

Hans Simtanda Caspersen

未读,
2013年10月7日 00:59:452013/10/7
收件人 google-cloud...@googlegroups.com
<?php 
 // Connects to your Database 
 mysql_connect(":/cloudsql/abcategories-com:authorbooksdatabase", "username", "password") or die(mysql_error()); 
 mysql_select_db("abc") or die(mysql_error()); 
 ?> 

--
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.

Hans Simtanda Caspersen

未读,
2013年10月7日 01:01:002013/10/7
收件人 google-cloud...@googlegroups.com
And the error is: Access denied for user 'ad...@simtanda.com'@'localhost' (using password: YES)

Razvan Musaloiu-E.

未读,
2013年10月7日 01:02:252013/10/7
收件人 google-cloud...@googlegroups.com
Can you try the username "root" without any password?

-- Razvan ME


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/81dea7e9-ff1c-4fc0-9a10-91fbcbbb8a07%40googlegroups.com.

Hans Simtanda Caspersen

未读,
2013年10月7日 01:06:082013/10/7
收件人 google-cloud...@googlegroups.com
Done, http://abcategories-com.appspot.com/ is now not showing errors

--
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.

Hans Simtanda Caspersen

未读,
2013年10月7日 01:09:412013/10/7
收件人 google-cloud...@googlegroups.com
so what does it mean

Joe Faith

未读,
2013年10月7日 11:07:542013/10/7
收件人 google-cloud...@googlegroups.com
Hi Hans

the documentation on setting instance-level access control should help:

Also see the MySQL documentation on managing MySQL users:

j


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/d58add61-2cac-4fad-a628-67d33c6fc6f7%40googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.



--
Joe Faith | Product Manager | Google Cloud

Hans Simtanda Caspersen

未读,
2013年10月7日 11:33:372013/10/7
收件人 google-cloud...@googlegroups.com
thanks

--
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.

Sandip Mavani

未读,
2018年11月15日 11:07:032018/11/15
收件人 Google Cloud SQL discuss
same issue but i have different error.

$connstr = ':/cloudsql/instancename';
$link = mysql_connect($connstr,'useraname','password');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';

No such file or directory

but same working in pdo

and this is necessary to user mysql_connect.

Dan (Cloud Platform Support)

未读,
2018年11月19日 17:18:192018/11/19
收件人 Google Cloud SQL discuss
Hello,

I believe that your questions should get a better assistance in the Stack Overflow[1] since it is related to a technical issue. There, you should receive help from the community fellow enthusiasts, and from Google engineers when you add a tag in your post according to the product where you require assistance, as you can check in our documentation[2]. Additionally, you can post some details regarding your setup, project config, and some code samples.

回复全部
回复作者
转发
0 个新帖子