Cloud66 tunnelling for database access

Posted About 7 years ago. Visible to the public.

You might be interested in connecting to a Cloud66 hosted database from your local conmputer, either via command console or database client (such as SequelPro).

To do that you first need to temporarily open a port so that your traffic can get to the server. One way to do that it to set firewall rules on the stack, but that's undesirable. If you have the Cloud66 toolbelt you can use that to temporarily open a connection as follows:

cx tunnel -s <stack name> -e <environment> --server <server name> --remote <remote port> --local <local port>

this, for example, directs your local port 5433 to the default PostgreSQL port on the Boco production server:

cx tunnel -s Boco -e production --server Hamster --remote 5432 --local 5433

As long as that's open (ctrl-c to end it), any traffic to localhost:5433 will get directed to the server.

Similarly you can use 3306 and 3307 for MySQL.

Note that when connecting to the database you'll need to specify the hostname, port, username and database as parameters to the command (sql/psql).

adre
Last edit
Almost 6 years ago
adre
Posted by adre to Foxsoft (2017-05-12 10:37)