I have the following problem.
I have two application created app_1 and app_2
On app_1 MySQL is installed and has the following parameters:
OPENSHIFT_MYSQL_DB_PORT = 3306
OPENSHIFT_MYSQL_DB_HOST = 127.9.101.2
OPENSHIFT_MYSQL_DB_PASSWORD = xxxx
OPENSHIFT_MYSQL_DB_USERNAME = xxxx
OPENSHIFT_MYSQL_DB_SOCKET = / var/lib/openshift/5252ca504382ecccc30000ca/mysql / / socket / mysql.sock
OPENSHIFT_MYSQL_DB_URL = mysql :/ / admindWSK1aY: [email protected]: 3306 /
OPENSHIFT_MYSQL_DB_LOG_DIR = / var/lib/openshift/5252ca504382ecccc30000ca/mysql / / log /
On app_1 I can easily connect via MySQL shell on my local database.
And command looks like this.
mysql -h 127.9.101.2 -u xxx -pxxx db325771
But when I run the same command on app_2, I get the following error message.
ERROR 2003 (HY000): Can not connect to MySQL server on '127 .9.101.2 '(113)
What am I doing wrong? How can I share one DB for a two apps?
Thank you
1) You need to create app 1 as a scalable database (rhc app create myapp pyton-2.6 mysql-5 -s)
2) You need to use the URL (not the ip) for the database in app_2
That should do it for your use case
The way to do this is as follows:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With