我使用了几天的Windows 8.1下的Appcelerator Studio与三星A5。现在我想使用mysql nodejs modul。我参与了网络的复制mysql副本的目录到我的资源目录下。 所以,我的文件夹看起来像这样:如何在Appcelerator中使用正确的MySQL nodejs模块?
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的模块未找到。
什么是错的。 请帮帮我!
感谢您的帮助和对不起我的英语!
添加有关mysql的“一般”答案,但也添加了如何让您的mysql节点模块工作:) –