【发布时间】:2016-05-31 15:22:15
【问题描述】:
我使用三星 A5 在 Windows 8.1 下的 Appcelerator Studio 有几天了。现在我想使用 mysql nodejs 模块。我在网上阅读了将mysql副本的目录复制到我的资源目录下的内容。 所以,我的文件夹是这样的:
Projectname
+-- Resources
+-- android
+-- mysql
| +-- lib
| | +--- ...
| +-- node_modules
| | +--- ...
| \- index.js
\- app.js
这是我的 app.js:
var mysql = require('mysql');
var connection = mysql.createConnection({
host: 'domain',
user: 'user',
password: 'password',
database: 'database'
});
connection.connect(function (err) {
if (err) {
alert("Error on mysql connect: " + err.stack);
return;
}
});
alert("Mysql connect is correct.");
connection.end();
项目在三星上安装,但是启动时报错:mysql module is not found.
怎么了。 请帮帮我!
感谢您的帮助,对不起我的英语!
【问题讨论】:
-
添加了关于 mysql 的“一般”答案,还添加了如何让 mysql 节点模块工作:)
标签: javascript android sqlite appcelerator appcelerator-titanium