Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
|
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 10th, 2005, 06:22 AM
Registered User
 
Join Date: Apr 2005
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default 'HELP'Can not acces MySQL from PHP


"I have been stock for days now." FROM A BEGINER ([email protected])
MYSQL SERVER 4.1

ERROR Mesage:

---Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in C:\Program Files\Apache Group\Apache2\Test\createmovie.php on line 8
Hey check yourn connection.---

<body>

<?php
-LINE 8- $connect = mysql_connect("localhost", "root", "MYPASSWORD") or die ("Hey check yourn connection.");

//Create a Data base
mysql_create_db("wiley")
or die(mysql_error());

// verify the current DB is the activeone
mysql_select_db ("wiley");

//Create "movie" table
$movie = "CREATE TEBLE movie (
    movie_id int(11) NOT NULL auto_increment,
    movie_name varchar(255) NOT NULL,
    movie_type tinyint(2) NOT NULL default 0,
    movie_year int(4) NOT NULL default 0,
    movie_leadactor int(11) NOT NULL default 0,
    movie_director int(11) NOT NULL default 0,
    PRIMARY KEY (movie_id),
    KEY movie_type (movie_type,movie_year)
    ) TYPE=MyISAM AUTO_INCREMENT=4 ";

    $results = mysql_query($movie)
    or die (mysql_error());

//Create "movietype" table
$movietype = "CREATE TABLE movietype (
    movietype_id int(11) NOT NULL auto_increment,
    movietype_label varchar(100) NOT NULL,
    PRIMARY KEY (people_id)
    )TYPE=MyISAM AUTO_INCREMENT=9";

$results = mysql_query($movietype)
or die(mysql_error());

// Create "people" Table
$people = "CREATE TABLE people (
    people_id int(11) NOT NULL auto_increment,
    people_fullname varchar(255) NOT NULL,
    people_isactor tinyint(1) NOT NULL default 0,
    people_isdirector tinyint(1) NOT NULL default 0,
    PRIMARY KEY (people_id)
) TYPE=MyISAM AUTO_INCREMENT=7";
$results = mysql_query($people)
    or die(mysql_error());

echo "Movie Database sucesfully created! ";
?>

</body>
</html>
 
Old April 14th, 2005, 06:09 AM
Friend of Wrox
 
Join Date: Dec 2004
Posts: 154
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I might be totaly mistaking here but I think I read something about that error in the forum somewhere- If I recall right, the problem is a DLL in the server which was corrupted in that version and was creating that problem.

Try to update Apache + MySQL and see if that work. The PHP code to connect is fine so it should work.






Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP-MySql imhappy Beginning PHP 1 September 24th, 2008 05:44 AM
mysql and PHP usom MySQL 1 September 6th, 2007 01:06 PM
begin php & mysql - chapter 12, user_form.php jon_stubber Beginning PHP 1 March 9th, 2006 10:57 AM
MySQL/PHP Gyhth PHP Databases 3 May 27th, 2005 08:21 PM
Using PHP with MySQL nav Beginning PHP 1 September 5th, 2004 04:02 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.