Re: pear DB::connect to mysql fails

From: Date: Tue, 11 Feb 2003 03:01:52 +0000
Subject: Re: pear DB::connect to mysql fails
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-3694@lists.php.net to get a copy of this message
This is a follow up to my original posting. I've found that PHP included in the Red Hat 8.0 doesn't enable mysql by default. So, as described in someone's suggestion in PHP manual, I've downloaded php-mysql rpm from rpmfind.net and installed it. However, the result is the same. Is that a way without recompiling apache, php and mysql? Any suggestions? Thanks, Scott "Scott Seong" <sseong@megapathdsl.net> wrote in message news:20030210074155.70367.qmail@pb1.pair.com... > Hi, > > I have just exposed to pear today, but couldn't get the db connect to work. > I'm running Red Hat 8.0, PHP 4.2.2 and mysql-3.23.52, and pear library > installed in "/usr/share/pear". The php.ini includes pear path in its > include_path. Here is the sample tutorial I have followed from example: > > <?php > require_once 'DB.php'; > > $user = "user"; > $pass = "pass"; > $host = "localhost"; > $db_name = "test"; > $dsn = "mysql://$user:$pass@$host/$db_name"; > echo $dsn; > > $db = DB::connect($dsn); > if (DB::isError($db)) { > die ($db->getMessage() ); > } > $db->disconnect(); > ?> > > And, the output is ... > > mysql://user:pass@localhost/testDB Error: no such database > > The mysql database "test" does exist on the system, and the permission for > "user" has been setup correctly. I am able to access described database > through mysql client and through java jdbc interface. But, I cannot get php > w/ pear to work. > > Thanks, > Scott > > >

« previous php.pear.general (#3694) next »