Francisco Souza
Francisco Souza

Reputation: 828

How to redirect only, and just only, mysql port to openshift?

Does anybody know how to redirect ONLY mysql port to openshift??

I don't want to redirect all available ports, I just need mysql be redirected.

francisco@francisco-desktop:~$ sudo rhc port-forward transportadora
[sudo] password for francisco: 
Checking available ports ... done
Forwarding ports ...
Address already in use - bind(2) while forwarding port 3306. Trying local port 3307

To connect to a service running on OpenShift, use the Local address

Service Local               OpenShift
------- -------------- ---- ---------------
java    127.0.0.1:3528  =>  127.2.25.1:3528
java    127.0.0.1:4447  =>  127.2.25.1:4447
java    127.0.0.1:5445  =>  127.2.25.1:5445
java    127.0.0.1:5455  =>  127.2.25.1:5455
java    127.0.0.1:8080  =>  127.2.25.1:8080
java    127.0.0.1:9990  =>  127.2.25.1:9990
java    127.0.0.1:9999  =>  127.2.25.1:9999
mysql   127.0.0.1:3307  =>  127.2.25.2:3306

Redirecting all ports is causing lots of trouble to my local development environment.

Thanks in advance!

Upvotes: 2

Views: 263

Answers (1)

Znatz
Znatz

Reputation: 1530

I had the same problem and finally found a workaround in Eclipse. You may do this.

  1. Install OpenShift plugin in Eclipse.

  2. In the server tab, navigate to port-forwarding like this

enter image description here

  1. [IMPORTANT] unchecked use '127.0.0.1' as the local address for all service

enter image description here

Your app can then use local server and connect remote mysql at the same time.

Upvotes: 1

Related Questions