Nodejs Numtel Mysql over a SSH connection
Nodejs Numtel Mysql over a SSH connection
我在使用 numtel meteor 包通过网络发送和接收 MySql 信息(位于服务器上的数据库)时遇到问题。目前,它能够使用他的包将信息从数据库推送到屏幕,但问题发生在第一次加载后。在第一次加载时,它能够从数据库中检索信息,并将其显示在屏幕上,但之后的任何内容,似乎触发器都损坏了,但只是一些。我能够将信息发送到服务器,但它似乎在动态检索时失败。信息被发送到服务器就可以了,但信息不会被检索并显示回屏幕上。它也只在我添加隧道代码时中断一次。它以前在同一台计算机上使用数据库时工作并获得更新。
messages = new MysqlSubscription('getMessages');
messages.addEventListener('update', function(diff, data) {
console.log("Event listener");
});
if (Meteor.isClient) {
Template.messageHistory.helpers({
messages: function () {
return messages.reactive();
}
});
}
if (Meteor.isServer) {
var Tunnel = Meteor.npmRequire('tunnel-ssh');
var config = {
host: "ourhost",
username: "uname",
password: "password",
port:22,
dstPort:3306,
srcPort:3307,
};
Tunnel.tunnel(config, function(err) { (err == null) ? console.log(config) : console.log(err) })
var liveDb = new LiveMysql({
host:"localhost",
port:3307,
database: "db",
user: "root",
password: "password"
});
Meteor.publish('getMessages', function() {
return liveDb.select(
'SELECT * FROM messages ORDER BY Timestamp',
[ { table: 'messages' } ]
);
});
}
我的问题出在我的 mysql 的 my.cnf 文件中。我有服务器 ID,需要server_id
相关文章:
- 任何将(SSH)终端嵌入到一些HTML5表示系统中的想法(例如,show.js)
- 类型错误'未定义'不是对象(正在评估'navigator.connection.type'
- 可以't从peerConnection Connection播放视频
- RTCMultiConnection exception on connection.addStream()
- node-mysql connection.query() returns undefined
- Javascript:connection.query函数正在破坏我的for循环
- 访问套接字中的其他套接字.在socket.io中打开('connection')
- WebSockets connection.send not function error
- 从 SSH 服务器获取 JSON 数据,其中包含 Javascript/Jquery 中的 url
- Signalr connection.start.done not firing
- stdout/stderror 不是 ssh-promise 库中承诺履行的一部分吗?
- SignalR $.connection is undefined
- socket.io 中的第二个 io.connection() 不会触发连接事件
- Nodejs Numtel Mysql over a SSH connection
- VMware webMKS(WMKS) console connection url?
- Google Chrome 应用程序:任何 SSH/SFTP JS 库
- ps au |grep ssh 在 Node.js (使用 spawn/pipe) 与 shell 中不同
- “类型错误:对象不是函数”,当使用tunnel-ssh时
- 节点&connection.query内部的MySQL-connection.query-对象属性不可访问
- 覆盖Ext.data.Connection-最佳实践