Connect to your database from your laptop
Open a tunnel from a port on your machine to a database, so any client on your laptop can use it.
All pages
- Open the database and, under Connection, choose Copy to copy its tunnel command. Run it in a terminal.
With the CLI, you can also type it yourself:
Terminalghaym cloud connect db --env production - The command prints a URL on
127.0.0.1, then the host, port, database and user a client's form asks for. Paste the URL into your client. For PostgreSQL and MySQL it also prints the command that opens the engine's own client,psqlormysql.Ghaym signs in for the client, so nothing printed carries a password.
- Press Ctrl-C to close the tunnel.
The tunnel takes the engine's own port when it is free, and the next free one when it isn't. Owners, admins and developers can open one.
--readerconnects to the database's readers instead of the writer. With no readers, it connects to the writer and says so.--portpicks the local port.
When the database has readers, Other commands beside Copy holds those commands too.
Terminal
ghaym cloud connect db --env production --readerOutside production, a database sleeps with its environment, and the command stops with an error. Add --wake to wake it and connect; the command the console copies already has it while the database sleeps. While the tunnel is open, the database stays awake.
Terminal
ghaym cloud connect db --env staging --wake