I'm trying to connect to a remote MySQL database with Pentaho Data Integration (JDBC Driver).
Therefore I need to build up a SSH connection.
Is it possible to do this inside/with the tool?
Guess I solved it:
I just had to build up a SSH Port Forwarding:
ssh -L 3306:localhost:3306 remote.url
There's no way to do this that I know of in PDI. But you wouldn't really want to. I would take the approach of configuring your MySQL client to use an encrypted connection, and then connect your JDBC driver to that.
Sorry, I don't do MySQL, so I don't know how to do that off the top of my head.
Brian
Related
This question has been edited for clarity...
Say I have a MySQL database, what are my options for performing queries from a remote computer and having access to the resulting data.
A convoluted solution I can think of is to have a web service that receives a query from a request and responds with an xml file of the results, but this seems like a bad way of doing it. What other options do I have of accessing a database remotely?
So, if you are going to write a Java application to connect to a MySQL database you have a few options:
use JDBC directly as described here: https://dev.mysql.com/doc/connector-j/5.1/en/connector-j-usagenotes-basic.html
Hibernate (http://docs.jboss.org/hibernate/orm/current/quickstart/html_single/) but that may be a little bit too complicated
Spring Data, here is a nice tutorial: https://spring.io/guides/gs/accessing-data-mysql/
JDBI (http://jdbi.org/) extremely simple ;)
There are 2 ways to do it.
1)
mysql -u {username} -p{password} -h {remote server ip} {DB name}
2)
In Windows :
-- Login to another system using putty or rdesktop
-- Access mysql database after login
In Linux:
-- ssh to another system using "ssh user#ip"
-- Access mysql database after login
You can follow this link for more details:
https://support.rackspace.com/how-to/mysql-connect-to-your-database-remotely/
https://dev.mysql.com/doc/refman/5.7/en/connecting.html
If you are using windows machine you can use MySQL Workbench and then you can just provide the details of the server where MySQL is hosted.
You can also use putty to do SSH if MySQL server is hosted in Linux.
Steps:
List item
SSH to the Server where MySQL server is hosted.
mysql -u root -pyourpassword.
I have a Talend Data Integration server (subscribtion product) and I want to load date to/from a MySQL database which is reachable over VPN tunnel.
Both servers are linux servers (RHEL).
Could you please suggest how can I connect from Talend to MySQL over VPN?
Thanks!
Create an SSH tunnel which makes MySQL appear on your localhost:3306 address then connect to that.
I'm using openshift to build my apps.
And I add mysql to my gear.
but, if I want to reach my database. I can't use Navicat which is my usual way to manage my database. I must ssh to my openshift server and then use command line 'mysql' to reach my database which is a bad way compared to Navicat.
So, how can I reach my database in Openshift with Navicat?
I've used env | grep MYSQL to get my mysql configration and use it in Navicat.
However, all is none effect.
If its a scalable application you should be able to connect to it externally via the connection information supplied by the environment variables. If its not a scalable app, then you'll need to use the rhc port-forward command to forward the necessary ports needed to connect.
Take a look at the following article here for more information. https://www.openshift.com/blogs/getting-started-with-port-forwarding-on-openshift
I have local MySql server and want Yii to connect to it over SSH. I have try to config config/main.php but failed. How can I do that?
You need to forward port 3306 from the remote server to your local machine and then set Yii to connect to the forwarded port on localhost.
As stated by hd1: This is something you need to do outside of PHP.
The best way is to create an SSH tunnel so that you have a port on the local server to talk to, that connects to your actual database server. There was a discussion on the Yii forum about exactly this, you can find it here
You might want to take a look at AutoSSH as well.
Plain and simple, can anyone explain me how to connect to a mysql server through a proxy (socks4/5). Preferable via the mysql command line (although there are no options for that in the client).
If it's not possible through the mysql command line than ANY other method will work.
All you need is to install and configure tsocks (transparent socks). It's available in most if not all linux distibutions. Afterwards you only need to prefix your command with 'tsocks', for example:
tsocks mysql -h -P .....
To my knowledge, it can't be done through the command line because the mysql command does not support proxy connections.
If both client and server are on a UNIX machine and one of them is accessible from the outside, I suggest using an SSH tunnel. It's basically a securely tunneled TCP connection that can be used for anything and the local mysql command can connect to the tunnel port easily.
If that's no option, you could write some kind of wrapper executable. For example, Java and Ruby have libraries that enable you to talk to SOCKS proxies and hook those sockets up to a MySQL or JDBC protocol implementation. What happens then depends entirely on what you have planned next.
If you've got admin access to the proxy server would there be much mileage in installing MySQL Proxy on it?