I am attaching a word document I put together with screen snapshots on how to connect to MySQL on a remote server using putty. I hope it helps those of you how have questions.
rch1231 169 Posting Shark
This attachment is potentially unsafe to open. It may be an executable that is capable of making changes to your file system, or it may require specific software to open. Use caution and only open this attachment if you are comfortable working with msword files.
- 1 Contributor
- 0 Replies
- 127 Views
Dani AI
Generated
The Putty walkthrough attached by is a useful visual guide. The brief notes below give a compact CLI equivalent, highlight common pitfalls that screenshots can miss, and add a short troubleshooting checklist to speed diagnosis when an SSH tunnel to MySQL fails.
For OpenSSH (Linux/macOS) a simple local-forward looks like:
ssh -L 3307:127.0.0.1:3306 user@ssh-host -N This maps local port 3307 to the remote server's 127.0.0.1:3306. Use -f -N to background the tunnel if desired. With the tunnel in place, connect with:
mysql -h 127.0.0.1 -P 3307 -u dbuser -p Note: use 127.0.0.1 (not localhost) so the client uses TCP rather than a local Unix socket.
Putty GUI equivalents: in Putty go to Connection > SSH > Tunnels, set Source port (for example 3307), Destination 127.0.0.1:3306, click Add, then save/open the session. If MySQL runs on a different machine inside the remote network, set Destination to that host:port (for example internal-db:3306), not the SSH host.
Quick troubleshooting checklist:
- Verify plain SSH to the server works before adding tunnels.
- Confirm MySQL is listening where expected (check
bind-addressandskip-networkingin my.cnf). See MySQL docs on bind-address (MySQL reference). - If a local MySQL server is already using 3306, choose a different local port (3307).
- Remember MySQL user grants: when tunneled, the server often sees connections as
localhost, so the DB user must have the appropriate host permissions. - Check server-side firewall and SELinux if applicable.
For Putty details and GUI alternatives, see the official Putty docs (PuTTY documentation) and MySQL Workbench SSH connection options (MySQL Workbench connections). Use key-based SSH auth and keep MySQL bound to localhost when possible to avoid exposing it to the internet.
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.