Unable to connect to Host database (WAMP newbie)
Posted by: David Floyd (212.225.98.---)
Date: January 03, 2010 11:54AM

I have used LAMP on my Linux machine for a couple of years and use it to maintain a website.

For various reasons I now also need to maintain this website on a Windows machine and I have just recently installed the latest WAMP.

Just to test things I have set up a temporary database (df6net1) at my host with one table (temp) with one field (temp) containing 'Hello World!'

My test script is:
<head>
<?
function makeXDBConnection() {
$link = mysql_connect('mysql13.streamline.net', 'df6net1', '123456')
or die();
// or die("Couldn't connect to Server."winking smiley;
mysql_select_db('df6net1')
or die();
// or die("Couldn't open database"winking smiley;
echo("Connected to database 'df6net1'"winking smiley;
}
makeXDBConnection();
?>
</head>
<body>
<br />
<?
$result = mysql_query("SELECT temp FROM temp"winking smiley;
$row = mysql_fetch_array($result,MYSQL_ASSOC);
extract($row);
echo $temp;
?>
</body>
</html>

Running this in my Linux localhost produces the expected result:
Connected to database 'df6net1'
Hello World!

But running the same script in my Windows localhost produces the following error messages:

Warning: mysql_connect() [function.mysql-connect]: OK packet 6 bytes shorter than expected in G:\wamp\www\mytest\index.php on line 4

Warning: mysql_connect() [function.mysql-connect]: mysqlnd cannot connect to MySQL 4.1+ using old authentication in G:\wamp\www\mytest\index.php on line 4

Any ideas or guidance would be welcome.

Thanks
David

PS I see the Preview shows stupid smiley things where there is supposed to be a closing bracket in the above code!!!

Options: ReplyQuote
Re: Unable to connect to Host database (WAMP newbie)
Posted by: stevenmartin99 (---.b-ras2.blp.dublin.eircom.net)
Date: January 03, 2010 12:41PM

mysql13.streamline.net


this shud be localhost

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

Options: ReplyQuote
Re: Unable to connect to Host database (WAMP newbie)
Posted by: David Floyd (212.225.98.---)
Date: January 03, 2010 12:52PM

I don't think so. I am trying to contact and read the database at my web host, not on my local machine, which I can do on a Linux machine with LAMP installed but not on a Windows machine with WAMP installed.

I can read databases on localhost without problem.

David

Options: ReplyQuote
Re: Unable to connect to Host database (WAMP newbie)
Posted by: stevenmartin99 (---.b-ras2.blp.dublin.eircom.net)
Date: January 03, 2010 01:02PM

oh so u are conencting to a different mysql


thats the issue then

mysqlnd cannot connect to MySQL 4.1+ using old authentication in G:\wamp\www\mytest\index.php on line 4



you can really only downgrade your php version to fix it cos you might not have permisson on in the mysql you wanna connect to to change things

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

Options: ReplyQuote
Re: Unable to connect to Host database (WAMP newbie)
Posted by: David Floyd (212.225.98.---)
Date: January 03, 2010 01:08PM

Thanks for your response and help.

But I'm afraid I do not understand the reply.

Are you suggesting that this is a deficiency in WAMP, as it works OK in LAMP.

So how do you you change permissions in mysql?

And why does the first part of the error message say "Warning: mysql_connect() [function.mysql-connect]: OK packet 6 bytes shorter than expected in G:\wamp\www\mytest\index.php on line 4 " and how do I cure that?

Any ideas?

With thanks in anticipation.

David

Options: ReplyQuote
Re: Unable to connect to Host database (WAMP newbie)
Posted by: stevenmartin99 (---.b-ras2.blp.dublin.eircom.net)
Date: January 03, 2010 01:25PM

no there is not deficency

the wamp you dowloaded is new and up to date. your LAMP stack isnt

its running old copies of php or mysql or both


you will need to make wamp replicate ur online server to make it match


its not difficult



left click wamp icon > php> verions> get more> download the one u need that matchs LAMP

Intall the FIle

left click wamp>php>version> tick the version you want


REPEAT FOR MYSQL

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

Options: ReplyQuote
Re: Unable to connect to Host database (WAMP newbie)
Posted by: David Floyd (212.225.98.---)
Date: January 03, 2010 01:34PM

Thanks for you help.

I am about to find out what my Web Host Provider uses for version of php and mysql then do as you suggest.

David

Options: ReplyQuote
Re: Unable to connect to Host database (WAMP newbie)
Posted by: David Floyd (---.dslaccess.co.uk)
Date: January 03, 2010 09:19PM

Steven,

Thanks for your advice.

I discovered that my web host is using Apache 1.3, MySQL 5.0.77 and PHP 5.2.9.5

So I've loaded Apache 1.34, MySQL 5.0.37 and PHP 5.2.11 and all works fine.

Thanks again for your help.

David

Options: ReplyQuote
Re: Unable to connect to Host database (WAMP newbie)
Posted by: stevenmartin99 (---.b-ras2.blp.dublin.eircom.net)
Date: January 03, 2010 10:13PM

ok thats cool - but that is a crazy mix

apache 1.3?! lol

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

Options: ReplyQuote


Sorry, only registered users may post in this forum.