1

My scalable osclass app need IP address of MYSQL.I try every thing to find out MYSQL IP but not get it. Following things i tried to find IP:

  1. rhc port-forward -a <appname> command but it show openshift IP address of HAPROXY and httpd not for Mysql.https://i.stack.imgur.com/Plujm.png

  2. Then buddy niharvey suggest me to ssh into app and type command env | grep MYSQL but result still not show ip address

(3) I even Type URL of MySQL instead of IP what i get from 2 try in osclass database setup page but it not working.

(4) I also try https://www.openshift.com/forums/openshift/how-install-custom-wordpress-setup-on-openshift-server method and edit config-sample.php file of osclass. as wordpess and osclass quite similar but that also not works.

I also post thread on openshift but no reply:(

My question how i get this.I think OPENSHIFT team also allow free tier user to Add PHPMYADMIN for scalble app.

luchaninov
  • 6,792
  • 6
  • 60
  • 75
gill
  • 83
  • 1
  • 9

2 Answers2

0

Since you are using a scalable application, your IP is actually a fully qualified domain name, you need to use the values of the OPENSHIFT_MYSQL_DB_HOST and OPENSHIFT_MYSQL_DB_PORT environment variables that are shown above.

AND< you should remove that screenshot, since scalable applications database gears are available to all gears on openshift, you are broadcasting your username and password to everyone on the internet...

And if this is your thread on openshift (https://www.openshift.com/forums/openshift/cant-connect-to-database) we did reply to you, you failed to give any details in your forum thread for us to be able to help you.

  • corey,thanks for reply but this is not my thread.i already use OPENSHIFT_MYSQL_DB_HOST and OPENSHIFT_MYSQL_DB_PORT environment variables as i discuss in no.04 try.how get ip for scalable app as osclass installtion support IP not Domain name.I use rhc ssh 'echo $OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT' command too.but it give me same result 52eee....-upme.rhcloud.com:37501 is there is kind of order exist in which IP is assign to cartidge ?.if yes,then IP of MYSQL will be find as IP address of HAPROXY and httpd is known – gill Feb 07 '14 at 13:28
0

SSH into your app using command rhc ssh <app> after ssh into your app, type in env | grep MYSQL then find OPENSHIFT_MYSQL_DB_HOST and copy the value it has something like this OPENSHIFT_MYSQL_DB_HOST = 56********************43-<domain>.rhcloud.com you need the second part, which is 56********************43-<domain>.rhcloud.com then while you are still inside the shell (ssh) of your app, ping the address you just got, ping 56********************43-<domain>.rhcloud.com . the resulting IP is the MYSQL server IP. I usually use the port in OPENSHIFT_MYSQL_DB_URL attached to the ip.

This may (not sure) differ in different apps.

You can extract the value of OPENSHIFT_MYSQL_DB_URL from the env | grep MYSQL command I described above.

The value is something similar to this OPENSHIFT_MYSQL_DB_URL=mysql://<MySQLusername>:<MySQLpassword>@56********************43-<domain>.rhcloud.com:61836

You could extract all the required info from here too.

Good luck on using it!

Hossein
  • 525
  • 3
  • 13