1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

help connecting to postgresql db

Discussion in 'Mac Programming' started by sk3pt1c, Mar 6, 2006.

  1. macrumors 6502a


    ok, i've been told to do this with putty which is for windows, but i wanna do it via terminal using bash. how do i set up the tunneling?can someone help out?

    1. In Putty, on the 'Session' configuration screen set it to connect using SSH to biscotti.cic.hull.ac.uk or nervosa.cic.hull.ac.uk as normal.
    2. Putty SSH tunnel configuration screenshotStill in Putty, select the 'Tunnels' section under 'SSH' and in the bottom section labelled 'Add new forwarded port' enter '4000' for 'Source port' and 'alexandria.cic.hull.ac.uk:5432' as 'Destination'. Press the 'Add' button. The screen should look like this:
    3. Press the 'Open' button in Putty to initiate the connection. Log in as normal and leave Putty running - it will catch all traffic on port 4000 and forward it to alexandria (the database server) via the SSH connection to nervosa or biscotti.
  2. macrumors 6502a


    my aim is to access a database i've created at uni via pgadmin on my powerbook

  3. macrumors 603


    In Terminal...

    ssh -L 4000:alexandria.cic.hull.ac.uk:5432 biscotti.cic.hull.ac.uk
    ssh -L 4000:alexandria.cic.hull.ac.uk:5432 nervosa.cic.hull.ac.uk
    Leave terminal running and the tunnel will remain open until you close the SSH session or exit terminal.

    Of course, you can optionally pass in a login name (two ways, one with a -l option or username@host) so it would then only prompt for a password. You can even save the session as a term file so you would just double click a shortcut and it would then prompt for your password, so you don't have to always type the commands. Alternatively, you could save it as a shell script...Many ways to kill this tunnelling bird.

    Edit: Always remember man is there for a reason.

    man ssh
  4. macrumors 6502a


    am not that good at unix, sorry

    done it and pgadmin says that the remote host basically said no to the connection

    any ideas?

Share This Page