I am trying to import data from a csv file to my cloud sql instance. I have managed to load the csv file into a bucket. I am following the instructions given in the below page.
https://cloud.google.com/sql/docs/mysql/import-export/importing
The five instruction are:
Create a Cloud Storage bucket, if you haven't already.
Upload the CSV file to your bucket.
Provide your instance with read permissions to your bucket.
Import the file using:
ACCESS_TOKEN="$(gcloud auth application-default print-access-token)" curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ --header 'Content-Type: application/json' \ --data '{"importContext": {"fileType": "CSV", "uri": "gs:///", "database": "", "csvImportOptions": {"table": ""}}}' \ -X POST \ https://www.googleapis.com/sql/v1beta4/projects/[PROJECT-ID]/instances/[INSTANCE_NAME]/import
- If you do not need to retain the permissions provided by the ACL you set previously, remove the ACL.
I am unable to understand what to do in step 3 which is "Provide your instance with read permissions to your bucket." How do I provide my instance which read permission?
Also in step 4, what is the significance of Access token and what does it do?