The reason the users are different is that Caldecott uses a different binding to the application where you inspected VCAP_SERVICES.
Inserting data into a cloudfoundry mysql database using vmc tunnel
-
08-12-2021 - |
Question
I am trying to insert data into a cloudfoundry mysql database as follows:
vmc tunnel myapp --port 10000 mysql
Then:
mysql> source /home/julien/Documents/donnees/projets/Site-Rencontres/java/src/main/resources/misc/sql/geolocation.sql
ERROR 1142 (42000): INSERT command denied to user 'udYra*****'@'172.30.*.*' for table 'geolocation'
What strikes me is that the user I retrieved using java.lang.System.getenv("VCAP_SERVICES");
is different from the one above:
"user":"ukqM8******"
My question is twofold:
- How can I prepopulate the cloudfoundry database with data?
- Why is the above user different from the one I retrieved from the VCAP_SERVICES env variable?
EDIT: I was able to succefully connect to mysql using vmc tunnel's none
option and then pointing to port 10000
from the mysql client. I am now running into mysql privileges issues and I opened another thread here on SO.
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow