Can't connect to MySQL
Posted by: Red_Maple_Leaf (---.dia.static.qwest.net)
Date: July 17, 2013 07:21PM

Hi,

I got the following error messages when I try to run the "testmysql" file:

Warning: mysql_connect(): php_network_getaddresses: getaddrinfo failed: No such host is known. in C:\wamp\www\testmysql.php on line 2
Could not connect to MySQL: php_network_getaddresses: getaddrinfo failed: No such host is known.

I haven't changed any of MySQL settings. I also have all the services on, and my WAMP server icon is in green.

Can you please help me connect to MySQL. Thanks!

Options: ReplyQuote
Re: Can't connect to MySQL
Posted by: RiggsFolly (---.as13285.net)
Date: July 17, 2013 07:39PM

Its just example code, you need to change it to this



<?php
$link = mysql_connect('localhost','root','');
if (!$link) {
die('Could not connect to MySQL: ' . mysql_error());
}
echo 'Connection OK'; mysql_close($link);
?>


No idea why they release it without that coding already done but they do.

Options: ReplyQuote
Re: Can't connect to MySQL
Posted by: Red_Maple_Leaf (---.dia.static.qwest.net)
Date: July 17, 2013 07:47PM

Hi,

It's fine now. Thanks!

Options: ReplyQuote


Sorry, only registered users may post in this forum.