MDB2 Failure to Connect to MySQL on OSX Mavericks

993 views Asked by At

Configuration:

Mac OS X 10.9.3
PHP 5.4.24 (default)
MySQL 5.6.17
pear list:
    MDB2              2.4.1   stable
    MDB2_Driver_mysql 1.4.1   stable
    PEAR              1.9.4   stable

I have a database in place on localhost and it's accessible with a particular account and password:

% mysql -u stacks -p password
mysql> use redseaexp_radtags;
Database changed
mysql> ^D

But:

% php -a
php > require_once("/usr/local/share/pear/MDB2.php");
php > $dsn = 'mysql://stacks:password@localhost/redseaexp_radtags';
php > $options = array();
php > $dbh = MDB2::connect($dsn, $options);
php > echo($dbh->getMessage() . "\n");
MDB2 Error: connect failed
php > echo($dbh->getUserInfo() . "\n");
connect: [Error message: No such file or directory]
[Native code: 2002]
[Native message: No such file or directory]
 ** mysql(mysql)://stacks:xxx@localhost/redseaexp_radtags
php > ^D

I don't see any issues with this code, but I could be missing something; the same errors occur if I leave off '/redseaexp_radtags'.

Is there perhaps a software compatibility issue?

0

There are 0 answers