I'd like to import sql data into my Cloud SQL database (named "db2"). Therefore I have uploaded a sql-file into my bucket. Then I go to my Cloud SQL database and click on "connect with Cloud Shell". When trying to import via CloudShell I get :
info@cloudshell:~ (servers)$ gcloud sql import sql db2 gs://mybucket/db.sql
Data from [gs://mybucket/db.sql] will be imported to [db2].
Do you want to continue (Y/n)? Y
ERROR: (gcloud.sql.import.sql) HTTPError 403: The service account does not have the required permissions for the bucket.
I have followed the solution given to a somewhat same issue here : https://stackoverflow.com/a/53608811/2795648 But this does not work for me.
The service account of my Cloud SQL database has ALL the permissions I can give on the bucket AND on the file (not that this is neccessary).
Some extra info added. Here are the rights of the service account :
- members:
- serviceAccount:[email protected]
role: roles/storage.admin
- members:
- serviceAccount:[email protected]
role: roles/storage.objectAdmin
- members:
- serviceAccount:[email protected]
role: roles/storage.objectCreator
- members:
- serviceAccount:[email protected]
role: roles/storage.objectViewer
- members:
- serviceAccount:[email protected]
role: roles/storagetransfer.admin
- members:
- serviceAccount:[email protected]
role: roles/storagetransfer.user
- members:
- serviceAccount:[email protected]
role: roles/storagetransfer.viewer