Re: DB::connect() and "No Such Database"
| From: | Gary Huntress | Date: | Wed, 15 Jan 2003 23:56:06 +0000 |
| Subject: | Re: DB::connect() and "No Such Database" | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-3317@lists.php.net to get a copy of this message | ||
After a bit more investigation, I'm pretty sure I know the answer. My
friends installation of php does not have mysql support! I think its a
pretty safe bet that PEAR needs mysql support in php in order to use
DB::connect("mysql://.......")
true?
Gary
"Markus Wolff" <wolff@21st.de> wrote in message
news:20030115084748.6AC2.WOLFF@21st.de...
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