Fail to install: Error #1 (more info, different Darwin)
-- EDITED TERMINAL SESSION --
$ export MYSQL_CONFIG=/Applications/MAMP/Library/bin/mysql_config $ echo $MYSQL_CONFIG /Applications/MAMP/Library/bin/mysql_config
$ cd /usr/local/lib/node
su root...
sh-3.2# npm install db-mysql npm http GET https://registry.npmjs.org/db-mysql npm http 200 https://registry.npmjs.org/db-mysql npm http GET https://registry.npmjs.org/db-mysql/-/db-mysql-0.7.6.tgz npm http 200 https://registry.npmjs.org/db-mysql/-/db-mysql-0.7.6.tgz
[email protected] install /usr/local/lib/node_modules/db-mysql node-waf configure build
Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
Checking for node path : not found
Checking for node prefix : ok /usr/local
Checking for program mysql_config : /Applications/MAMP/Library/bin/mysql_config
Checking for library mysqlclient_r : Missing libmysqlclient_r
'configure' finished successfully (0.552s)
Waf: Entering directory `/usr/local/lib/node_modules/db-mysql/build'
[ 1/12] cxx: lib/node-db/binding.cc -> build/Release/lib/node-db/binding_1.o
[ 2/12] cxx: lib/node-db/connection.cc -> build/Release/lib/node-db/connection_1.o
[ 3/12] cxx: lib/node-db/events.cc -> build/Release/lib/node-db/events_1.o
[ 4/12] cxx: lib/node-db/exception.cc -> build/Release/lib/node-db/exception_1.o
[ 5/12] cxx: lib/node-db/query.cc -> build/Release/lib/node-db/query_1.o
[ 6/12] cxx: lib/node-db/result.cc -> build/Release/lib/node-db/result_1.o
[ 7/12] cxx: src/connection.cc -> build/Release/src/connection_1.o
In file included from ../src/connection.cc:2:
../src/./connection.h:5:19: error: mysql.h: No such file or directory
In file included from ../src/./connection.h:8,
from ../src/connection.cc:2:
../src/././result.h:16: error: expected ‘,’ or ‘...’ before ‘&’ token
../src/connection.cc:154: error: ‘const class node_db_mysql::Connection’ has no member named ‘connection’ Waf: Leaving directory `/usr/local/lib/node_modules/db-mysql/build' Build failed: -> task failed (err #1): {task: cxx connection.cc -> connection_1.o}
[email protected] preuninstall /usr/local/lib/node_modules/db-mysql rm -rf build/*
npm ERR! [email protected] install: node-waf configure build
npm ERR! sh "-c" "node-waf configure build" failed with 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the db-mysql package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-waf configure build
npm ERR! You can get their info via:
npm ERR! npm owner ls db-mysql
npm ERR! There is likely additional logging output above.
npm ERR! System Darwin 10.8.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "db-mysql"
npm ERR! cwd /usr/local/lib/node
npm ERR! node -v v0.8.15
npm ERR! npm -v 1.1.66
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /usr/local/lib/node/npm-debug.log
npm ERR! not ok code 0

Don't know if this problem is special only to Darwin but I suspect that the include path that is expanded on row 15 in binding.gyp results in string with "-I" at the beginning although the gyp expects the just path.
If I try on commad line
mysql_config --include
I got
-I/usr/local/mysql/include
Anyway, after replacing the contents of the single quotes on that row with just the path to the mysql includes, I was successful to build the db-mysql on OS X 10.6.8. I was also able to successfully build it when I replaced mysql_config --include in the binding.gyp with:
mysql_config --variable=pkgincludedir