can't get any php script to connect with mysql

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
user51564
Forum Newbie
Posts: 16
Joined: Sun Apr 30, 2006 3:39 pm
Location: Ok
Contact:

can't get any php script to connect with mysql

Post by user51564 »

can get a pel scipt to connect but not php scripts...do i need to know the socket? says it can not authninicate....
user51564
Forum Newbie
Posts: 16
Joined: Sun Apr 30, 2006 3:39 pm
Location: Ok
Contact:

error i get with php scripts...

Post by user51564 »

i get this error: Client does not support authentication protocol requested by server; consider upgrading MySQL client
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

What version is MySQL and what version of the client are you using? phpinfo() has the client details.
user51564
Forum Newbie
Posts: 16
Joined: Sun Apr 30, 2006 3:39 pm
Location: Ok
Contact:

here is the info...

Post by user51564 »

MySQL 5.0
os winxp pro sp2
apache 2.55
php 4
Array ( [0] => standard [1] => bcmath [2] => calendar [3] => ctype [4] => com [5] => ftp [6] => mysql [7] => odbc [8] => overload [9] => pcre [10] => session [11] => tokenizer [12] => xml [13] => wddx [14] => zlib [15] => apache2handler [16] => mbstring [17] => bz2 [18] => cpdf [19] => crack [20] => curl [21] => db [22] => dba [23] => dbase [24] => dbx [25] => exif [26] => filepro [27] => gd [28] => hyperwave [29] => imap [30] => ldap [31] => mime_magic [32] => ming [33] => pdf [34] => pgsql [35] => sockets [36] => Win32 API [37] => zip )
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

You need to use MySQLi to connect to MySQL 5.
user51564
Forum Newbie
Posts: 16
Joined: Sun Apr 30, 2006 3:39 pm
Location: Ok
Contact:

php.ini

Post by user51564 »

is this right?

Code: Select all

; Allow or prevent persistent links.
mysql.allow_persistent = On

; Maximum number of persistent links.  -1 means no limit.
mysql.max_persistent = -1

; Maximum number of links (persistent + non-persistent).  -1 means no limit.
mysql.max_links = -1

; Default port number for mysql_connect().  If unset, mysql_connect() will use
; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
; compile-time value defined MYSQL_PORT (in that order).  Win32 will only look
; at MYSQL_PORT.
mysql.default_port = 3306

; Default socket name for local MySQL connects.  If empty, uses the built-in
; MySQL defaults.
mysql.default_socket =

; Default host for mysql_connect() (doesn't apply in safe mode).
mysql.default_host = "localhost" 

; Default user for mysql_connect() (doesn't apply in safe mode).
mysql.default_user = "root"
User avatar
dibyendrah
Forum Contributor
Posts: 491
Joined: Wed Oct 19, 2005 5:14 am
Location: Nepal
Contact:

Post by dibyendrah »

The problem is due to the old MySQL Client .
Go through this URL http://dev.mysql.com/doc/refman/5.0/en/old-client.html .

Cheers,
Dibyendra
Post Reply