function.mysql-connect error (MYSQL)
Posted by: slangman (212.85.12.---)
Date: September 26, 2011 03:05PM

Hi

I recently installed Wamp Server, to test out PHP/MYSQL pages. However I am having problems getting mysql to work via the testmysql page from my local host. I keep getting the following errors.

Warning: mysql_connect() [function.mysql-connect]: php_network_getaddresses: getaddrinfo failed: No such host is known. in C:\wamp\www\testmysql.php on line 2

Warning: mysql_connect() [function.mysql-connect]: [2002] php_network_getaddresses: getaddrinfo failed: No such host is kn (trying to connect via tcp://hostname:3306) in C:\wamp\www\testmysql.php on line 2

Warning: mysql_connect() [function.mysql-connect]: php_network_getaddresses: getaddrinfo failed: No such host is known. in C:\wamp\www\testmysql.php on line 2

PHP seems to be working OK however.

As I am new to all this PHP/MYSQL stuff, I have no idea what is causing this error. I have already set up a password via PHPAdmin and via the php config file.

I don’t know if I have any conflicting software. If there was a conflict, how would I go about solving this?

Am I supposed to modify something else that i haven’t done yet?

Many thanks for your time.

Options: ReplyQuote
Re: function.mysql-connect error (MYSQL)
Posted by: stevenmartin99 (---.251.255.12.threembb.ie)
Date: September 26, 2011 04:18PM

If u set a password using phpmyadmin then everything is working ok.

Just delete that test file- cos ur supposed to open it and fill in your details

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: function.mysql-connect error (MYSQL)
Posted by: yfastud (Moderator)
Date: September 27, 2011 12:50AM

You need to setup DB account first

You should setup Backup right after setup Wamp successful, so you can go back if something wrong later
To setup Backup, follow this
[blog.jlbn.net]

To setup Password, follow this
[blog.jlbn.net]

To setup Website w/ Wamp, follow this
[blog.jlbn.net]

To setup Database Account, follow this
[blog.jlbn.net]

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: function.mysql-connect error (MYSQL)
Posted by: slangman (194.80.246.---)
Date: September 29, 2011 12:52PM

Ok, I followed stevenmartin99's advice, and that seems to working for me. Didn't realise you were supossed to add stuff to that test page, which was what confused me at first.

@ yfastud , yeah I already had set up a DB account at the time.

Thanks for the help! smiling smiley

Options: ReplyQuote


Sorry, only registered users may post in this forum.