Re: DB::connect() and "No Such Database"

From: Date: Wed, 15 Jan 2003 07:55:04 +0000
Subject: Re: DB::connect() and "No Such Database"
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-3307@lists.php.net to get a copy of this message
Am Tue, 14 Jan 2003 22:11:41 -0500 schrieb "Gary Huntress" <ghuntress@attbi.com>: > I'm having trouble with my first "hello world" PEAR DB connection and > I'm not sure what I'm doing wrong. My code is extremely generic: > > <?php > require_once("DB.php"); > $user="xxxx"; > $pass="xxxx"; > $db = DB::connect("mysql://$user:$pass@192.168.1.15/mysql",false); > if(DB::isError($db)) > { > echo $db->getMessage(); > } > ?> > > And my error is "DB Error: No such database", however using the mysql > command line with that host, user, pass and db I can log in ok (I'm > confident that the mysql grants are OK) Code looks perfectly okay, there must be something wrong with your connection data, grants or DB configuration in general. Try to connect with the same settings using PHP´s native MySQL functions. If this also fails, your problem is not with PEAR::DB. Regards, Markus -- *21st Media* | Consulting, Konzeption, Produktion für die Bereiche: Markus Wolff | Internet, Intranet, eCommerce, Content Management, Hamburg,Germany | Softwareentwicklung, 3D-Animation, Videostreaming http://21st.de | Tel. [+49](0)40/6887949-0, Fax: [+49](0)40/6887949-1

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