NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
MySQL Error


Joined: 28 Jun 2005
Posts: 1
Reply with quote
Hi I have created the following page (test.php)

<?
$user="user1";
$password="password";
$database="database";
mysql_connect(localhost,$user,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="CREATE TABLE contacts (id int(6) NOT NULL auto_increment,first varchar(15) NOT NULL,last varchar(15) NOT NULL,phone varchar(20) NOT NULL,mobile varchar(20) NOT NULL,fax varchar(20) NOT NULL,email varchar(30) NOT NULL,web varchar(30) NOT NULL,PRIMARY KEY (id),UNIQUE id (id),KEY id_2 (id))";
mysql_query($query);
mysql_close();
?>

When I browse to localhost/test.php the file executes as expected and creates the tables in mysql.

However when I try to run (preview) the file within PhpED I get presented with the follwoing error:

Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in C:\Inetpub\wwwroot\test.php on line 6
Unable to select database

I have replaced both libmySQL.dll files that I found within the install directory with the orginal in the mysql directory but this does'nt have seemed to have worked.

It looks like a great product except for this annoying problem.

Any idea's how I could correct it greatly appreciated.
View user's profileFind all posts by andyww14Send private message


Joined: 21 Oct 2004
Posts: 81
Location: UK
Reply with quote
I've got that error before, I don't think it's anything to do with PHPed.

It has to do with MySQL 4.0 and 4.1 - between these, the way a client (PHP in this case) connects to the server changed, so in PHP you use mysqli (MySQL Improved) rather than mysql functions (check php.net for more info).

Are the 2 executions trying to connect to *exactly* the same MySQL server (ie. not just servers on the same machine)?
View user's profileFind all posts by QuboidSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Effectively it means that when you "browse to this file" outside the IDE, you run it with one php version, while inside IDE you do it with another.

If you use php5, you may want to install php5 for phped. Look for this package on our web (http://shop.nusphere.com)
View user's profileFind all posts by dmitriSend private messageVisit poster's website
MySQL Error
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic