In Netbeans, I need to create a connection to a remote MySql database over SSH. I am given SSH hostname, SSH username, SSH password, MySql hostname (127.0.0.1) and MySql username (root). In a new Connection Wizard I am not sure what to do since there is ssh involved. How should my JDBC Url look like? Is it even possible to achieve this from a gui wizard?
相关问题
- Difference between Types.INTEGER and Types.NULL in
- sqlyog export query result as csv
- NOT DISTINCT query in mySQL
- MySQL: conduct a basic search
- Why sometimes there is one of more gap(s) in the v
Hmm. I reckon the best way for you to do this is to set up port forwarding before attempting to connect to your remote database via NetBeans.
I'm not sure what OS your using but, assuming you are using some flavour of Linux here are the steps to take:
1) Forward a local port to your remote MySQL Database server Open up a terminal window and type:
You'll be prompted for your SSH password. Enter it.
2) In Netbeans go to Services and set up a new MySQL database connection with the following credentials:
host: 127.0.0.1
username: root (I'm assuming that the remote MySQL db allows remote root connections?)
password: password (I guess you must have a password for the MySQL database that you're connecting to?!)
The jdbc url should look something like this:
There's a good post here for more details on port fowarding/tunnelling.
Good luck and I hope this helps!