/    Sign up×
Community /Pin to ProfileBookmark

can’t connect to mysql with php script

I’m having a hard time getting my php script to connect to mysql properly,
the php script consists of the following code:

<?php

mysql_connect(“localhost”,”root”,”password”)
or die (“Could not connect to database”);
mysql_select_db(“menagerie”)
or die (“could not select database”);

echo “All tasks successful”;
mysql_close();
?>

When I run the page, I get this error:

[B]Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in /Users/me/Sites/testing/sql_mena.php on line 8[/B]
Could not connect to database

I’m on an iMac (OS X 10.3.3)
PHP Version 4.3.2
MySQL Version 4.1.10 -standard

Any help would be greatly appreciated

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@ShrineDesignsMar 23.2005 — in order to have support for MySQL 4.1.x, you need to download the libmysqli library from php.net or download and install php5 (which comes with the mysqli library)

alot of people including me have run into the same problems use MySQL 4.1.x and php, i would recommend running MySQL 4.0.x for the time being until a solid version of 4.1 comes out
×

Success!

Help @T-Wag spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...