【问题标题】:mysql cluster node js connection errormysql集群节点js连接错误
【发布时间】:2014-02-24 13:52:44
【问题描述】:

我正在尝试将 mysql 集群与节点 js 连接

我的程序

var nosql = require('mysql-js');

var dbProperties = {

    "implementation" : "ndb",

    "database" : "users"

};

nosql.openSession(dbProperties, null, onSession);

我收到此错误。

https://dev.mysql.com/doc/ndbapi/en/ndb-nodejs-setup.html

Error: Cannot find module 'mysql-js'

at Function.Module._resolveFilename (module.js:338:15) 

at Function.Module._load (module.js:280:25)


if i try to install with npm install mysql-js i am getting below error

npm http GET https://registry.npmjs.org/mysql-js

npm http 404 https://registry.npmjs.org/mysql-js

npm ERR! 404 'mysql-js' is not in the npm registry.

npm ERR! 404 You should bug the author to publish it

npm ERR! 404
npm ERR! 404 Maybe try 'npm search mysql'

npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, or http url, or git url.

【问题讨论】:

  • 您的机器上是否安装了“node-mysql 驱动程序”?

标签: node.js mysql-cluster


【解决方案1】:

你必须下载那个模块,你必须把它放在“node_modules”目录中。

【讨论】:

    【解决方案2】:

    您需要安装 mysql-js。 为此,请转到命令提示符并转到您拥有项目的根目录。

    npm install mysql-js
    

    然后运行应用程序

    node app.js //Assuming app.js is the your app file
    

    【讨论】:

      【解决方案3】:

      你应该像这样安装那个模块:

      npm install mysql/mysql-js
      

      npm 擅长 Github 存储库)

      请注意,它会询问一些与您的 MySQL 安装相关的问题。

      【讨论】:

        【解决方案4】:

        您需要使用作为 MySQL 集群一部分的 node.js 驱动程序软件 - 您可以在这篇文章中看到一个有效的教程:
        Using JavaScript and Node.js with MySQL Cluster – First steps

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2019-02-01
          • 2019-07-31
          • 1970-01-01
          • 2018-10-29
          • 2018-08-10
          • 2020-01-22
          相关资源
          最近更新 更多