When installing mysql-libmysqlclient gives errors.

$ npm install mysql-libmysqlclient npm WARN package.json moniker@0.1.2 No repository field. npm http GET https://registry.npmjs.org/mysql-libmysqlclient npm http 304 https://registry.npmjs.org/mysql-libmysqlclient npm http GET https://registry.npmjs.org/nan npm http 304 https://registry.npmjs.org/nan > mysql-libmysqlclient@1.6.0 install /home/web/game/node_modules/mysql-libmysqlclient > node-gyp rebuild make: Entering directory `/home/web/game/node_modules/mysql-libmysqlclient/build' CXX(target) Release/obj.target/mysql_bindings/src/mysql_bindings.o In file included from ../src/mysql_bindings.cc:17: ../src/./mysql_bindings_connection.h:11:19: warning: mysql.h: No such file or directory In file included from ../src/mysql_bindings.cc:17: ../src/./mysql_bindings_connection.h:76: error: ISO C++ forbids declaration of 'MYSQL' with no type ../src/./mysql_bindings_connection.h:76: error: expected ';' before '*' token ../src/./mysql_bindings_connection.h:82: error: 'my_bool' does not name a type ../src/./mysql_bindings_connection.h:189: error: ISO C++ forbids declaration of 'MYSQL_RES' with no type ../src/./mysql_bindings_connection.h:189: error: expected ';' before '*' token ../src/./mysql_bindings_connection.h:191: error: 'my_ulonglong' does not name a type ../src/./mysql_bindings_connection.h:192: error: 'my_ulonglong' does not name a type ../src/./mysql_bindings_connection.h:210: error: 'MYSQL' has not been declared ../src/./mysql_bindings_connection.h:212: error: 'MYSQL' has not been declared In file included from ../src/mysql_bindings.cc:18: ../src/./mysql_bindings_result.h:41: error: 'MYSQL' has not been declared ../src/./mysql_bindings_result.h:41: error: 'MYSQL_RES' has not been declared ../src/./mysql_bindings_result.h:43: error: 'MYSQL_FIELD' has not been declared ../src/./mysql_bindings_result.h:45: error: 'MYSQL_FIELD' has not been declared ../src/./mysql_bindings_result.h:56: error: ISO C++ forbids declaration of 'MYSQL' with no type ../src/./mysql_bindings_result.h:56: error: expected ';' before '*' token ../src/./mysql_bindings_result.h:57: error: ISO C++ forbids declaration of 'MYSQL_RES' with no type ../src/./mysql_bindings_result.h:57: error: expected ';' before '*' token ../src/./mysql_bindings_result.h:63: error: expected ')' before '*' token ../src/./mysql_bindings_result.h:89: error: ISO C++ forbids declaration of 'MYSQL_FIELD' with no type ../src/./mysql_bindings_result.h:89: error: expected ';' before '*' token In file included from ../src/mysql_bindings.cc:19: ../src/./mysql_bindings_statement.h:50: error: 'MYSQL_STMT' has not been declared ../src/./mysql_bindings_statement.h:53: error: ISO C++ forbids declaration of 'MYSQL_STMT' with no type ../src/./mysql_bindings_statement.h:53: error: expected ';' before '*' token ../src/./mysql_bindings_statement.h:55: error: ISO C++ forbids declaration of 'MYSQL_BIND' with no type ../src/./mysql_bindings_statement.h:55: error: expected ';' before '*' token ../src/./mysql_bindings_statement.h:56: error: ISO C++ forbids declaration of 'MYSQL_BIND' with no type ../src/./mysql_bindings_statement.h:56: error: expected ';' before '*' token ../src/./mysql_bindings_statement.h:70: error: expected ')' before '*' token ../src/./mysql_bindings_statement.h:124: error: ISO C++ forbids declaration of 'MYSQL_RES' with no type ../src/./mysql_bindings_statement.h:124: error: expected ';' before '*' token ../src/./mysql_bindings_statement.h:143: error: 'MYSQL_BIND' has not been declared ../src/./mysql_bindings_statement.h:145: error: 'MYSQL_FIELD' has not been declared ../src/mysql_bindings.cc: In function 'void InitMysqlLibmysqlclient(v8::Handle<v8::Object>)': ../src/mysql_bindings.cc:40: error: 'CLIENT_COMPRESS' was not declared in this scope ../src/mysql_bindings.cc:41: error: 'CLIENT_FOUND_ROWS' was not declared in this scope ../src/mysql_bindings.cc:42: error: 'CLIENT_IGNORE_SIGPIPE' was not declared in this scope ../src/mysql_bindings.cc:43: error: 'CLIENT_IGNORE_SPACE' was not declared in this scope ../src/mysql_bindings.cc:44: error: 'CLIENT_INTERACTIVE' was not declared in this scope ../src/mysql_bindings.cc:47: error: 'CLIENT_MULTI_RESULTS' was not declared in this scope ../src/mysql_bindings.cc:48: error: 'CLIENT_MULTI_STATEMENTS' was not declared in this scope ../src/mysql_bindings.cc:49: error: 'CLIENT_NO_SCHEMA' was not declared in this scope ../src/mysql_bindings.cc:57: error: 'CLIENT_REMEMBER_OPTIONS' was not declared in this scope ../src/mysql_bindings.cc:60: error: 'MYSQL_INIT_COMMAND' was not declared in this scope ../src/mysql_bindings.cc:61: error: 'MYSQL_OPT_COMPRESS' was not declared in this scope ../src/mysql_bindings.cc:62: error: 'MYSQL_OPT_CONNECT_TIMEOUT' was not declared in this scope ../src/mysql_bindings.cc:65: error: 'MYSQL_OPT_LOCAL_INFILE' was not declared in this scope ../src/mysql_bindings.cc:68: error: 'MYSQL_OPT_PROTOCOL' was not declared in this scope ../src/mysql_bindings.cc:69: error: 'MYSQL_OPT_READ_TIMEOUT' was not declared in this scope ../src/mysql_bindings.cc:70: error: 'MYSQL_OPT_RECONNECT' was not declared in this scope ../src/mysql_bindings.cc:73: error: 'MYSQL_OPT_SSL_VERIFY_SERVER_CERT' was not declared in this scope ../src/mysql_bindings.cc:80: error: 'MYSQL_OPT_WRITE_TIMEOUT' was not declared in this scope ../src/mysql_bindings.cc:81: error: 'MYSQL_READ_DEFAULT_FILE' was not declared in this scope ../src/mysql_bindings.cc:82: error: 'MYSQL_READ_DEFAULT_GROUP' was not declared in this scope ../src/mysql_bindings.cc:83: error: 'MYSQL_REPORT_DATA_TRUNCATION' was not declared in this scope ../src/mysql_bindings.cc:84: error: 'MYSQL_SECURE_AUTH' was not declared in this scope ../src/mysql_bindings.cc:85: error: 'MYSQL_SET_CHARSET_DIR' was not declared in this scope ../src/mysql_bindings.cc:86: error: 'MYSQL_SET_CHARSET_NAME' was not declared in this scope ../src/mysql_bindings.cc:91: error: 'STMT_ATTR_UPDATE_MAX_LENGTH' was not declared in this scope ../src/mysql_bindings.cc:92: error: 'STMT_ATTR_CURSOR_TYPE' was not declared in this scope ../src/mysql_bindings.cc:93: error: 'STMT_ATTR_PREFETCH_ROWS' was not declared in this scope make: *** [Release/obj.target/mysql_bindings/src/mysql_bindings.o] Error 1 make: Leaving directory `/home/web/game/node_modules/mysql-libmysqlclient/build' gyp ERR! build error gyp ERR! stack Error: `make` failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23) gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:789:12) gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /home/web/game/node_modules/mysql-libmysqlclient gyp ERR! node -v v0.10.24 gyp ERR! node-gyp -v v0.12.1 gyp ERR! not ok npm ERR! mysql-libmysqlclient@1.6.0 install: `node-gyp rebuild` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the mysql-libmysqlclient@1.6.0 install script. npm ERR! This is most likely a problem with the mysql-libmysqlclient package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-gyp rebuild npm ERR! You can get their info via: npm ERR! npm owner ls mysql-libmysqlclient npm ERR! There is likely additional logging output above. npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "mysql-libmysqlclient" npm ERR! cwd /home/web/game npm ERR! node -v v0.10.24 npm ERR! npm -v 1.3.21 npm ERR! code ELIFECYCLE npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /home/web/game/npm-debug.log npm ERR! not ok code 0 

Maybe someone faced this problem?

  • one
    warning: mysql.h: No such file or directory - obviously the libmysqlclient-dev package is not installed (if it is a debian based distr) - zb '11
  • I installed these packages, but it still doesn’t find mysql.h and further errors are added. Ie all the errors of their file mysql_bindings_connection.h. - Jeix
  • @Jeix, find /usr/include -name mysql.h will find the file? - etki
  • @Fike, no - Jeix
  • 2
    @Jeix is ​​understandable, I messed up CentOS with ubunt C descriptal on github (where one could have a look):> For CentOS:>> \ #> yum install mysql-devel - etki

1 answer 1

warning: mysql.h: No such file or directory

mysql header files are not installed.

In the centos distribution, this can be done, for example, with the command:

 $ sudo yum install mysql-devel