To connect to a remote MySQL server using MySQL Workbench and openSSH, you'll need to convert the openSSH (rlogin) connection to a MySQL connection. Here's a step-by-step guide:
-
Install MySQL Connector/OpenSSH: Download and install the MySQL Connector/OpenSSH package on your local machine. The package is available for various platforms, including Linux, macOS, and Windows.
-
Configure SSH Tunnel: On your local machine, open the terminal and execute the following command to create an SSH tunnel:
ssh -L 3306:localhost:3306 username@remote_hostReplace
usernamewith your username andremote_hostwith the remote host's address. -
Configure MySQL Workbench: Open MySQL Workbench and follow these steps:
a. Click on the "New Connection" button.
b. Select the "Standard TCP/IP over SSH" connection method.
c. Fill in the following details:
- Hostname:
localhost - Port:
3306 - Username: Your MySQL username
- Password: Your MySQL password
d. Click on the "Advanced" tab and enter the SSH username and password in the respective fields.
e. Click on the "Finish" button to create the connection.
- Hostname:
Now, you should be able to connect to the remote MySQL server using MySQL Workbench.
References:
- MySQL Connector/OpenSSH: https://dev.mysql.com/downloads/connector/openssh/
- MySQL Workbench: https://dev.mysql.com/downloads/workbench/
- Configuring MySQL Workbench: https://dev.mysql.com/doc/workbench/en/wb-connecting-to-a-server.html