Configuration:
Mac OS X 10.9.3
PHP 5.4.24 (default)
Stacks 1.19
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> show tables
+-----------------------------+
| Tables_in_redseaexp_radtags |
+-----------------------------+
| alleles |
| batches |
| catalog_alleles |
| catalog_annotations |
| catalog_genotypes |
| catalog_snps |
| catalog_tags |
| chr_index |
| fst |
| ... |
+-----------------------------+
21 rows in set (0.00 sec)
However, when I try to connect to the database with Stacks (or with similar php on the command line) I get an error message:
File: /usr/local/share/stacks/php/db_functions.php (line 42) MDB2 Error: connect failed. 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
These error messages result from the MDB2 connection, using code from Stacks on the command line:
php > require_once("/usr/local/share/pear/MDB2.php");
php > require_once("constants.php");
php > $database = "redseaexp_radtags";
php > $dsn = 'mysql://' . $db_user . ':' . $db_pass . '@' . $db_host . '/' . $database ;
php > echo($dsn . "\n");
mysql://stacks:password@localhost/redseaexp_radtags
php > $options = array();
php > $dbh = MDB2::connect($dsn, $options);
Thanks for any assistance.
-- Andy
Yes, localhost is the correct server. I can login with
mysql -u stacks -p password -h localhost redseaexp_radtags
for the same result.
I have not tried vStacks. At $50 I thought I’d try to get the free version going first.
-- Andy
require_once("/usr/local/share/pear/MDB2.php");
without complaint. I can’t remember now if that location’s different than Stacks’ default; if so, it wasn’t pointing to anything useful, i.e. I don’t believe that Mac OS’ php installation includes MDB2.
-- Andy
php > require_once("/usr/local/share/pear/MDB2.php");
php & gt; require_once("constants.php");
php > $database = "redseaexp_radtags";
php > $dsn = 'mysql://' . $db_user . ':' . $db_pass . '@' . $db_host . '/' . $database ;
php > echo($dsn . "\n");
mysql://stacks:password@localhost/redseaexp_radtags
php > $options = array();
< p style="margin-bottom:0px;font-size:11px;line-height:normal;font-family:Menlo">php > $dbh = MDB2::connect($dsn, $options);