我添加了QuotaGuard Static add-on,它包含兩個ip地址。我將這些地址添加到我的Google Cloud Sql的授權網絡中。之後我嘗試使用guide連接到tha數據庫。這裏是我的代碼:
exports.getConnection =() ->
dbConnParams =
host: 'google cloud sql ip'
port: 3306
proxy = url.parse process.env.QUOTAGUARDSTATIC_URL
auth = proxy.auth;
username = auth.split(":")[0]
pass = auth.split(":")[1]
sock_options =
host: proxy.hostname
port: proxy.port
user: username
pass: pass
sockConn = new SocksConnection dbConnParams, sock_options
dbConnection = mysql.createConnection({
user: 'root',
password: 'pwd',
stream: sockConn
});
return dbConnection
但是,我得到一個錯誤:「連接ECONNREFUSED」。這種方法有什麼問題?
你想創建什麼樣的事件/用戶定義的函數? – brennebeck 2014-09-03 09:18:23
確定性函數和從某個表中刪除而不是實際數據的事件 – Dmitriy 2014-09-03 09:30:51