mysql-ssh-pool
v1.0.6
Published
Execute mysql commands over an ssh tunnel.
Downloads
3
Readme
MySQL SSH POOL
This a personnal, quick & dirty 'fix' of MySQL SSH package, to use PoolConnections instead of an only one MySQL connection. Only for personnal purposes, but feel free to use it as you want (didn't create any test or anything else)
Aim of initial project : Sets up a MySQL connection inside an SSH tunnel. This is practical when you want to reach a database which is only accessible through a webserver. Even if the database server is not located on the webserver itself.
API
.connect(obj sshConfig, obj dbConfig)
sshConfig
should be an object according to thessh2
package.dbConfig
should be an object according to themysql2
package.- Returns a Promise, containing a PoolConnection from the
mysql2
package.
Usage
Don't forget to .closePool()
the connection when you're done querying the database.