Openshift, unable to connect to mysql from console

I am connected via SSH to my opening server. I type: env | grep MYSQL

OPENSHIFT_MYSQL_DB_PORT=42361 OPENSHIFT_MYSQL_DB_HOST=XXXXXXX-mydomain.rhcloud.com OPENSHIFT_MYSQL_DB_PASSWORD=MYPASSWORD OPENSHIFT_MYSQL_PATH_ELEMENT=/opt/rh/mysql55/root/usr/bin OPENSHIFT_MYSQL_DB_GEAR_UUID=XXXXXXXXX OPENSHIFT_MYSQL_DB_USERNAME=MYUSERNAME OPENSHIFT_MYSQL_DB_URL=mysql://MYUSERNAME: MYPASSWORD@XXXXXX-mydomain.rhcloud.com :42361/ OPENSHIFT_MYSQL_LD_LIBRARY_PATH_ELEMENT=/opt/rh/mysql55/root/usr/lib64 OPENSHIFT_MYSQL_DB_GEAR_DNS=XXXXXXX-mydomain.rhcloud.com 

Then i ran

 mysql -u $OPENSHIFT_MYSQL_DB_USERNAME -h $OPENSHIFT_MYSQL_DB_HOST -P $OPENSHIFT_MYSQL_DB_PORT -p 

and enter the same password ... but I get this error: ERROR 1045 (28000): access is denied for the user "MYUSERNAME'@'10.169.187.123" (using password: YES)

I cannot access mysql and my application shows a 503 inaccessible error (I think for this reason).

I do not want to lose the data stored inside, so I would like to change the password or something like that. But since I cannot connect to mysql, I cannot change psw as follows:

 \> set password for 'MYUSERNAME'@'10.169.187.123' = PASSWORD('newpassword'); 
0
mysql openshift
source share
3 answers

Have you tried accessing the database through the phpMyAdmin page? It should be available at http: //.rhcloud.com/phpmyadmin. The credentials for accessing this page are provided to you when you create the MySQL cartridge. The default username is "admin". If you no longer have an administrator password, you, of course, are out of luck too.

0
source share

You were so close! When connecting, you must specify the MySQL password.

mysql -u $ OPENSHIFT_MYSQL_DB_USERNAME -h $ OPENSHIFT_MYSQL_DB_HOST -P OPENSHIFT_MYSQL_DB_PORT --password = $ OPENSHIFT_MYSQL_DB_PASSWORD

0
source share

I know the post is outdated, but I had the same problem and @Tadhg's answer was close. So, I tried the following in rhc environment after connecting to rhc ssh <APP_NAME> and connected me to mysql.

 mysql -u $OPENSHIFT_MYSQL_DB_USERNAME -h $OPENSHIFT_MYSQL_DB_HOST --password=$OPENSHIFT_MYSQL_DB_PASSWORD 

I need to remove the port since it had an error on the port and it worked. I could not use phpMyAdmin as I get the error `phpmyadmin-4 cannot be embedded in a scalable application '.

I hope this helps someone, one day. :)

0
source share

All Articles