2

I am having issues with user privileges in mysql and cloudfoundry.

I was able to insert data into a table and I am trying to insert data into another table and running into the following issue:

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 'uEs8kO1Aqdhlr'@'172.30.49.208' for table 'geolocation'

Can anyone please clarify to me how user privileges work on mysql for cloudfoundry?

EDIT 1: Some info:

+-------------------------------------------------------------------------------------------------------------------------------------------+
| Grants for uEs8kO1Aqdhlr@%                                                                                                                |
+-------------------------------------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'uEs8kO1Aqdhlr'@'%' IDENTIFIED BY PASSWORD '*A826C24476F83F907DC66060E4C2705D92E151ED' WITH MAX_USER_CONNECTIONS 20 |
| GRANT ALL PRIVILEGES ON `de2474fdd53114ebfbb17b3c236676a28`.* TO 'uEs8kO1Aqdhlr'@'%'                                                      |
+-------------------------------------------------------------------------------------------------------------------------------------------+

EDIT 2: Some more info:

mysql> select user();
+-----------------------------+
| user()                      |
+-----------------------------+
| uEs8kO1Aqdhlr@172.30.49.208 |
+-----------------------------+
1 row in set (0.80 sec)

mysql> select current_user();
+-----------------+
| current_user()  |
+-----------------+
| uEs8kO1Aqdhlr@% |
+-----------------+
1 row in set (0.85 sec)

EDIT 3: Yet some more info:

I realized that my sql script was referring the wrong schema (here called dummy):

insert into dummy.geolocation

Removing the "dummy." allowed me to run the script without any error. Why this gave me the above error I am not sure. If any one can explain, that would be useful...

balteo
  • 23,602
  • 63
  • 219
  • 412

1 Answers1

1

CF provisions both the mysql instance as well as a database. Therefore when you bind a mysql service you actually bind the database to your app. If you notice when vmc tunnelling to the mysql service, it gives you the username/password as well as a key called "name", that is the schema name the tunnel is on. Operations against other schemas would be considered out of the CF account used.

William Gu
  • 852
  • 1
  • 8
  • 14