Jump to content


Photo

cant get php to connect with mysql


  • Please log in to reply
2 replies to this topic

#1 essjay_d12

essjay_d12
  • Members
  • PipPipPip
  • Advanced Member
  • 121 posts

Posted 31 January 2006 - 02:23 PM

Hi I am trying a simple connection string ....

<?php
$conn = mysql_connect("localhost", "admin", "adm1n");
echo $conn;
?>

then i get an error message when it is run....

Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in C:\Program Files\Apache Group\Apache2\htdocs\dbConnect.php on line 2

I am running MySql server 5.0.18
apache 2.0.55
and php 4.3.3

What exactly is it asking me to upgrade?

the admin/adm1n user and password was granted all priviledges on a database called 'project' and the onyl table called 'users' (there is no root user or password)

I am new to all this, Please help

Thanks,

Simon

#2 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 31 January 2006 - 06:06 PM

I suggest you check out [a href=\"http://dev.mysql.com/doc/mysql/en/old-client.html\" target=\"_blank\"]this relevant refman page[/a] for more details.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#3 phptryhard

phptryhard
  • Members
  • Pip
  • Newbie
  • 9 posts
  • LocationOntario, Canada

Posted 03 February 2006 - 01:57 AM

you don't declare a db in your connect statement

[code=auto:0]
<?php
$sv = localhost;
$un = username;
$pw = password;
$db = database;


$link = mysqli_connect("$sv", "$un", "$pw", "$db");
?>
PHP 5.1.1
Apache 2.2.0 (WIN32)
mySQL 5.0.18




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users